aspose file tools*
The moose likes Struts and the fly likes Struts basic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts basic" Watch "Struts basic" New topic
Author

Struts basic

C Kushtawar
Ranch Hand

Joined: Jan 20, 2009
Posts: 37
I have set up a basic struts application based on a MiniHR example from the book "Struts-The Complete Reference".
It has compiled well.But when i deploy to the Tomcat server and run url "http://localhost:8080/MiniHR/"

It throws the below error.I think there are some settings missing.can you please help me on this.Also please let me know where can i get a sample struts application with details.

[Error]
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: javax/servlet/jsp/tagext/TagExtraInfo
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:244)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagExtraInfo
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:621)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$000(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
java.lang.ClassLoader.loadClass(ClassLoader.java:300)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
java.lang.ClassLoader.loadClass(ClassLoader.java:252)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1255)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:419)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)




[/Error]
Ram Para
Ranch Hand

Joined: Jul 09, 2008
Posts: 50
Can you paste the JSP code. It seems to be as if some tag lib is missing.


Ram Parashar
http://doinfinite.com
C Kushtawar
Ranch Hand

Joined: Jan 20, 2009
Posts: 37
Please find the jsp code
=====================






Regards,
Chandan

Ram Para
Ranch Hand

Joined: Jul 09, 2008
Posts: 50
Can I assume that you have struts-html.tld in WEB-INF/tlds folder.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

C Kushtawar please take time to Carefully Choose One Forum when you start a topic. The Web Services forum is not a place to ask a Struts question...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

The taglib directive as given in my book (Struts - Complete Reference 2nd Edition page 13) is



You don't need to put the tld files manually in WEB-INF folder, the container searches for the tlds inside jar files...
Ram Para
Ranch Hand

Joined: Jul 09, 2008
Posts: 50
Ankit I am talking about the line of code which is being used in JSP.

<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>

Either this need to be changed or use global URL(better option).
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

Ram Para wrote:Ankit I am talking about the line of code which is being used in JSP.


Yes I know, I was pointing out that the code that kushtawar is using is not given in the book. And the URI he is using, will work if he takes the tld file from the struts jar file and put it in the /WEB-INF/tlds folder, which is not needed in new containers, so if he is not using an old container, then he doesn't needs to do this. I'm not sure what the URI used in struts 1.x for HTML tags is, so I just gave the code (taglib directive) given in the book, it should work...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts basic