jsp- adding user defined functions to a jsp

Ads
 

jsp- adding user defined functions to a jsp

Trying to write the function as below but getting errors. Can you please identify the cause of error and how to correct it.

<% public String retrieveAndClearErrorMessage(HttpSession session) { String errorMessage = (String)session.getAttribute("errorMessage"); if(errorMessage == null) { errorMessage = ""; } session.removeAttribute("errorMessage"); return errorMessage; }

%>

Error: (error after "retrieveAndClearErrorMessage". It does not like the parameter.) Multiple annotations found at this line: - Syntax error on token ")", ; expected - Syntax error on token "(", ; expected

View Answers

August 9, 2012 at 10:47 PM

Got it , had to use <% ! %>

instead of <% %>

Ads









Related Tutorials/Questions & Answers:
jsp- adding user defined functions to a jsp
jsp- adding user defined functions to a jsp  Trying to write the function as below but getting errors. Can you please identify the cause of error and how to correct it. <% public String retrieveAndClearErrorMessage
user defined function inside a jsp
user defined function inside a jsp  how to write a user defined function inside a jsp page
Advertisements
Remove attribute in user defined session - JSP-Servlet
Remove attribute in user defined session  Hi, How we can set remove attribute for user defined session. I am appreciating if you are sending solution as soon as possible? Thanks, Sanat Kumar
jsp pages for dispatchaction for adding user to database
jsp pages for dispatchaction for adding user to database  ...;title>Add User</title> </head> <form name="user" action...;tr> <td>User Name</td> <td><input type="text
How to create file and save it into user defined path using jsp/servlet?
How to create file and save it into user defined path using jsp/servlet?  Hi.. Onclick event I have created one file.When file will create it should asked where to save file(like browse option
JSP
(user defined methods) can't access them as they are local to the service method and are created at the conversion time of a jsp into a servlet. But we can pass... objects in jsp   Implicit objects in jsp are the objects
JSP
(user defined methods) can't access them as they are local to the service method and are created at the conversion time of a jsp into a servlet. But we can pass... objects in jsp   Implicit objects in jsp are the objects
JSP
are used for different purposes. Our own methods (user defined methods) can't access... objects are used for different purposes. Our own methods (user defined methods...JSP  what are different implicit objects of jsp   mplicit
JSP User-Agent
JSP User-Agent          JSP User-Agent is used to display... illustrate an example from 'JSP User-Agent'. To understand and elaborate the example we
jsp
jsp  how to write a servlet and jsp program for user login form
jsp
jsp  how to write a servlet and jsp program for user login form
JSP
JSP  what are the different scopes an object can have in a jsp page   JSP Scope Variables: Page scope-It makes the data available... to the given user, it is accessible from any page in the system
Adding image to database through jsp or HTML page ,while adding only image should show.
Adding image to database through jsp or HTML page ,while adding only image should show.   Adding image to database through jsp or HTML page,while adding only image should show. After that i need view that uploaded image from
creating columns and adding label and textfield in the columns in a jsp page
creating columns and adding label and textfield in the columns in a jsp page  I have create a jsp page with 3 columns.....each column has a title,3 label and corresponding 3 text fields....can u send me the code
JSP
JSP   Develop a JSP to keep track number of users and display a message ‚??You are nth visitor‚?? where n is number of user
JSP custom tags
JSP custom tags       JSP custom tags are the user-defined following a special XML syntax to which... way that a Java class file is used to handle JavaBean calls for a JSP page
JSP
JSP  How to run jsp program in eclipse
jsp
jsp  how to create jsp page
Jsp
Jsp  Can I implement interface in jsp
JSP
what is JSP forward tag for  what is JSP forward tag for   It forwards the current request to another JSP page. Below is the syntax for the same:- <jsp:forward page="...url..." /> We can also forward parameter
jsp
jsp  how to include two jsp page
jsp
jsp  how jsp translated into servlets
JSP
://www.roseindia.net/jsp/simple-jsp-example/UseBean.shtml <jsp:useBean id="user... and the valuesaccessed. <jsp:useBean id="user" class="MyUserClass" scope="session"/> <...how can we use beans in jsp  how can we use beans in jsp   
jsp
jsp  how to create a table in oracle using jsp and the table name is entered in text feild of jsp page
jsp
jsp  write a code for jsp file generator to generate a jsp page automatically taking html page as input
jsp
jsp  Hi I don know any frame works...I am tryin to create a page in jsp which should get translated to Indian languages like kannada , telugu etc..when user selects a language can u help me out.. thanks
JSP
JSP  Hi, What is JSP? What is the use of JSP? Thanks   Hi, JSP Stands for Java Server Pages. It is Java technology for developing web applications. JSP is very easy to learn and it allows the developers to use Java
jsp
jsp  how to connect the database with jsp using mysql   Hi Friend, Please visit the following links: http://www.roseindia.net/jsp/connectjspwith_mysql.shtml http://www.roseindia.net/jsp/Accessingdatabase-fromJSP.shtml
jsp
jsp   what is the basic necessities reguired for running jsp using JDBC bridge?? and how to write a jsp code to access the detail present in microsoft access pls send link regarding above
JSP
JSP   How to create CAPTCHA creation by using JSP? I need an code for CAPTCHA creation by using JSP...   You can create a captcha validation using jsp. Have a look at the following tutorial: Captcha Creation
jsp
jsp  how to pass jsp variable to an html page

Ads