Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie lost in JSP

 
xue shen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a login.html file which has two simple textfield for username and password. The form action is validation.jsp.
I am using xhtml for the html parts.
the validation.jsp uses a userBean the userBean checks to see if the username and password fields were blank, if they are, return the user back to the login.html, otherwise sent the user to further validation with the database.
I could not pass this validation.jsp
The following error keeps on coming no matter what I do. Please help
org.apache.jasper.compiler.ParseException: /Chemistry site/loginValidate.jsp(2,90) Attribute , has no value
The code are:
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*", "java.util.*" errorPage="" %>
<jsp:useBean id="userBean" class="userBean" scope="request">
<jsp:setProperty name ="userBean" property="username" param="username"/>
<jsp:setProperty name="userBean" property="password" param="password"/>
</jsp:useBean>
<html xmlns="http://www.w3.org/1999/xhtml">
in the body of the file:
<%
if(userBean.validate()){
%>
<jsp:forward page="finalValidation.jsp"/>

<%
} else {
%>
<jsp:forward page="loginagain.jsp"/>
<%
}
%>

Please please help on this issue.
thanks
x.S
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Xue
Which line is the compiler error pointing to? It is most likely that you have the errorPAge attribute in the tag but no page specified.
 
xue shen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Dave;
I delete the errorPage ="" and still got the same problem.
Here is the error message:
org.apache.jasper.compiler.ParseException: /Chemistry site/loginValidate.jsp(2,90) Attribute , has no value
please help. I am completely stuck at the moment.
x.s
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess it's expecting a value for an attribute but it does not find any supplied.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using this syntax: import="java.util.*, java.lang.*" for the import statements. Note that you currently have quotes around the packages and a comma between the quoted strings-- you need to put quotes around the set of packages, with commas between each package name.
Kyle
 
xue shen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. I agree with that except I do not see anything wrong with the code with my inexperienced eye.
I generally having probelms here running jsp with javabeans. I tried to run the example of coreserlets, the StringBean example, I get the class not found exception on both j2ee server and tomcat. I put the StringBean.class in the /examples/WEB-INF fold and the StringBean.jsp file in the /examples/jsp fold, I also tried put the class file in WEB-INF and the jsp file in examples folder, both situation result the same error:
Apache tomcat/4.04--HTTP Status 500 - Internal Server Error
org.apache.jasper.JasperException: coreservlets.StringBean
at org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:183)
at org.apache.jasper.compiler.GetPropertyGenerator.generate(GetPropertyGenerator.java:102)
at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:841)
at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:253)
at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:209)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:215)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:536)

root cause
java.lang.ClassNotFoundException: coreservlets.StringBean
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1406)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
at org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:181)
at org.apache.jasper.compiler.GetPropertyGenerator.generate(GetPropertyGenerator.java:102)
at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:841)
at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:253)
at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:209)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:215)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:536)
and when I try it in j2ee server, i put the bean in the public_html/mysite/coreservlets folder and the jsp file in public_html/mysite/jsp folder
and it results the same classnotfoundexception.
Please help
 
Tiffany Sun
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should create a subdirectory called coreservlets under classes, for StringBean.class.
Could you please post your login.html file?
Tiffany
 
xue shen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers;
Thanks all for the input. I have sorted the problems. Basically, I did not put the beans in the right directory and somehow it did not like to have the two import condensed into one.
I am running it now with tomcat 4.0.4 stand alone. I would like to run them in Sun Studio one, I think I may still have not put them in the right directory for sun studion one, since while try to use forte to run the same thing it could not find the bean classes.
Any help would be appreciated
Thanks
X.S.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic