I am getting an error on this page when trying to do the example in the newsletter on Struts 1.1
Here is the error
Anyone know why I am getting this error? Does it really have to do with the LoginView.jsp? Or could the error be the result of another file? [ May 28, 2003: Message edited by: Thomas Paul ]
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
Do you have your tld files defined in your web.xml? Are they in the right location?
Originally posted by Thomas Paul: Do you have your tld files defined in your web.xml? Are they in the right location?
Here is my web.xml file
And my tld files are located under my WEB-INF folder.
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
Here's your problem:
In your web.xml, you define the URI as: /WEB-INBF/struts-template but you coded your JSP to use this URI: /WEB-INBF/struts-template.tld Those two have to be identical for it to work.
here is error I got when I changed to UPPER CASE HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: /WEB-INF/jsp/discover/contract/reviewerDecisionPanel.jsp(3,4) Invalid directive at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126) at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:383) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:795) at org.apache.jasper.compiler.Parser.parse(Parser.java:122) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356) at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1759) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1596) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) 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:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:536)
-------------------------------------------------------------------------------- Apache Tomcat/4.1.24 make all char small letter .
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
BTW which editor you are using ?? I am using TextPad for jsp and Eclipse for Java. TextPad shows different color[blue] for <%@ taglib uri and normal color[black] for <%@ TAGLIB URI you have to download plugin for jsp syntax coloring available at textpad.com
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
Good catch, Ravish! Now I can stop pulling my hair out!
Well, good news. Thanks to Ravish and Thomas, I am not getting any errors. BUT.... Now I am just getting a blank page. I am starting to go bald because of this simple example. I really don't know why it would be a blank page. I basically copy and pasted the code from the newsletter for the jsp page. Any ideas?
Originally posted by Thomas Paul: If you do "view source" what do you see?
There is a whole lot of Javascript but no actual FORM tags or plain html tags anywhere. And the <HTML> is never closed.
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
write one SOP just before forwarding string. and make sure you have entry of that forward in your action.
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
Originally posted by Gregg Bolinger:
There is a whole lot of Javascript but no actual FORM tags or plain html tags anywhere. And the <HTML> is never closed.
Originally posted by Gregg Bolinger: I am getting an error on this page when trying to do the example in the newsletter on Struts 1.1
I cant see closing HTML tag in this html file. Are you sure you have closing </HTML> tag in your JSP ??
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
Originally posted by Gregg Bolinger:
There is a whole lot of Javascript but no actual FORM tags or plain html tags anywhere. And the <HTML> is never closed.
The HTML is never closed because we forgot to put in a close HTML tag. But that shouldn't screw anything up. There should be a lot of JavaScript. The question is why aren't the tags being turned into html.
Originally posted by Ravish Kumar: [QB[/qb]<hr></blockquote> I cant see closing HTML tag in this html file. Are you sure you have closing </HTML> tag in your JSP ??[/QB]
I had caught that before posting the problem. So yes, I have the closing </html> tag. Here is my file, again...
So something is blowing up. I am going to look at my class files again.
Darryl A. J. Staflund
Ranch Hand
Joined: Oct 06, 2002
Posts: 303
posted
0
Hi Greg, If you are getting a 'form bean null' error, the problem is probably with your struts-config.xml file. Make sure that your action definition has a name attribute containing the name of the dynaform you wish to use on the page. Here is an example of how it should look like:
The 'name' is used to associate a form bean with a Struts action. If you don't define it, you will get 'form bean null' type errors. Hope this helps. Darryl
I am getting a new error now though. Still a blank page, but in the error logs I get...
Isn't this fun?? [ May 28, 2003: Message edited by: Gregg Bolinger ]
Darryl A. J. Staflund
Ranch Hand
Joined: Oct 06, 2002
Posts: 303
posted
0
Hi there, Sometimes when I get strange errors like this, I validate my web.xml and struts-config.xml files to make sure they are well-formed. It's happened to me on a number of occasions where the application loaded without error but didn't fully parse the configuration file because of errors in form. Boy do I sound out of ideas, don't I? :-) Darryl
Originally posted by Darryl A. J. Staflund: Hi there, Sometimes when I get strange errors like this, I validate my web.xml and struts-config.xml files to make sure they are well-formed. It's happened to me on a number of occasions where the application loaded without error but didn't fully parse the configuration file because of errors in form. Boy do I sound out of ideas, don't I? :-) Darryl
You and me both are out of ideas. So is there an easy way for me to validate my XML files?
Darryl A. J. Staflund
Ranch Hand
Joined: Oct 06, 2002
Posts: 303
posted
0
Just download a demo of XML Spy from Altova. Darryl
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
is this class is in your classpath org.apache.struts.validator.DynaValidatorForm I have not used this class but it seems that its not finding the class. It seems that some class should extend this class. Do you have that class? can you provide line num 97 of LoginView_jsp.java ? You can find this file in work folder if you are using Tomcat with default setting.
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
You don't have a form-beans tag in your struts-config.xml!!!
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
one more NOTE: xml files are also case sensitive. I saw some tags in CAPS in your xml file. just try making them small letters.
Line 97 reads if (pageContext != null) pageContext.handlePageException(t); And org.apache.struts.validator.DynaValidatorForm is part of struts.jar in v1.1
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
Originally posted by Thomas Paul: You don't have a form-beans tag in your struts-config.xml!!!
Yes .. I think this is the problem .. and thats why its not getting Login bean ..
Originally posted by Thomas Paul: You don't have a form-beans tag in your struts-config.xml!!!
Ahh, then this is a typo on your part. You stated in your 1.1 newsletter article to change the struts-config.xml file to have the following:
I guess you left of the s??
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
Originally posted by Gregg Bolinger: Line 97 reads if (pageContext != null) pageContext.handlePageException(t); And org.apache.struts.validator.DynaValidatorForm is part of struts.jar in v1.1
thats what I was fearing ... this is almost last line of the generated code. It does not help at all. Error is somewhere else not at line 97.
Ok, fixed the struts-config file to have <form-beans> instead of <form-bean> and still getting a blank page and a "Cannot retrieve definition for form bean login" in the error logs. I really appreciate everyone that is helping me through this problem.
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
Originally posted by Gregg Bolinger: <hr></blockquote>
Ahh, then this is a typo on your part. You stated in your 1.1 newsletter article to change the struts-config.xml file to have the following:
I guess you left of the s??[/QB]
actually all <form-bean> tag should be inside <form-beans> tag.
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
this might help you you need login name to access it but its worth to be member here
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
Originally posted by Gregg Bolinger: Ok, fixed the struts-config file to have <form-beans> instead of <form-bean> and still getting a blank page and a "Cannot retrieve definition for form bean login" in the error logs. I really appreciate everyone that is helping me through this problem.
No your strut-config.xml should be like this
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.