|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I encounter a problem. I using J2SDK 1.4.0 and Apachea Tomcat 4.1. I write my servlet program which it will verify my user ID and password and output a jsp (usr02a.jsp) to show the name of the user. My program able to verify & output the jsp fine. But if I include the the below line in my program it show error as below: org.apache.jasper.JasperException: usr The line I added which cause error is: <tr> <td><strong>Name</strong></td> <td><input type="text" name="@Name" value=" <%= ((usr) session.getAttribute("UserProfile")).getName()%> " size=30 maxlength=30 > </td> </tr> <tr> The JSP tag I put in is to get the previous session attribute name to include in the JSP output. If I take out the whole thing as below show : <tr> <td><strong>Name</strong></td> <td><input type="text" name="@Name" value="" size=30 maxlength=30 > </td> </tr> <tr> The JSP output can show without error but my purpose to show the user name is not achieved. the usr is a class which I compiled in C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\classes\env\ (the purpose is to verify id and password and get the values of name(in getName() method)) I using Windows XP and I have set the classpath for above directory in windows XP environment variable in control-> system. The above error message post is when my servlet try to catch the exception do below portion: ( see the SendErrorPage line ) try { HttpSession session = request.getSession(true); session.setAttribute("UserProfile", UsrC); RequestDispatcher rd = getServletContext().getRequestDispatcher ("/jsp/usr02a.jsp"); rd.forward(request, response); } catch(Exception e) { try { doGet(request, response, e.toString()); // SendErrorPage } catch(Exception e1) {} I greatly appreciate if any Servlet / JSP expert can help me on this. I have try to check the problem a few months but still unable to solve it. Best regard. |
|
#2
|
||||
|
||||
|
Couple things I can spot here.
First, you are casting getName() object into your usr class. I am not sure that is way you want to use the usr class if your intension is to verify authentication. Try to creat usr class object and call your verification method by passing the getName() object maybe? Second, (you probably did, but did posted?) you should declared your usr class with package env. Then either import that into the jsp page, or use a fully quilify path name for the class. Hope this help.
__________________
Help me, help you, help others...
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > org.apache.jasper.JasperException |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|