This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi,
can you please tell, how to build and deploy a struts application in tomcat webserver.
Thanks in Advance
Siddharth
Shailesh Narkhede
Ranch Hand
Joined: Jul 10, 2008
Posts: 356
posted
0
check THIS link.
you will get some example of struts with Tomcat.
Thanks,
Shailesh
siddharth das
Ranch Hand
Joined: Aug 17, 2007
Posts: 124
posted
0
Please tell me the detail steps and what is the directory structure.
Thanks
Siddharth
siddharth das
Ranch Hand
Joined: Aug 17, 2007
Posts: 124
posted
0
Please tell me the detail steps and what is the directory structure.
Thanks
Siddharth
siddharth das
Ranch Hand
Joined: Aug 17, 2007
Posts: 124
posted
0
I unable to do .
Please give some other link.
Thanks,
Siddharth
Shailesh Narkhede
Ranch Hand
Joined: Jul 10, 2008
Posts: 356
posted
0
>> webapp >> appName >> WEB-INF >> classes >> put your actions & actionforms classes here (according to package structure).
JSPs any where as in general web application.
>> webapp >> appName >> WEB-INF >> lib >> put struts jar & all related struts custom tag library files.
>> webapp >> appName >> WEB-INF >> put struts-config.xml,web.xml,struts custom tag library .tld files.
restart tomcat & type URL to JSP resource in your application.
The files in /WEB-INF/lib are put in the webapp's classpath.
You may want to read up on basic Java webapp deployment--these questions aren't really Struts-specific. There's nothing special about a Struts webapp; you just need to deploy the appropriate libraries and have a reasonable configuration.
Shailesh Narkhede
Ranch Hand
Joined: Jul 10, 2008
Posts: 356
posted
0
Please post the code you tried & error you getting.
siddharth das
Ranch Hand
Joined: Aug 17, 2007
Posts: 124
posted
0
when i compiled MyAction.java,got compilation error as "cannot resolve symbol ActionMapping"
Well, you'll need the Struts jars in the classpath, and whatever the version of Struts you're using depends on.
How to do the compilation depends on how your compiling (using an IDE, Ant, Maven, command-line, etc.) and isn't really Struts-specific. The dependencies depend on which version of Struts you're using--some Struts downloads contain all the dependencies, some don't, but searching the web, reading the documentation, etc. are usually sufficient to get the dependency matrix.
siddharth das
Ranch Hand
Joined: Aug 17, 2007
Posts: 124
posted
0
I am not using ANT or any IDE.
I simply develop the code in notepad and put those files in the respective folder.
Then I go to command prompt and try to compile the java classes.
I am using struts 1.3.8.
Can it be possible or i have to use ANT.
Please tell me.
Thanks,
Siddharth Das
No, you don't *have* to use Ant. Or a real editor.
But you *do* need to have the Struts libraries on the classpath to compile. For beginner Java questions, like setting the classpath etc. you're probably better off in the Java-General-beginner forum. Just ask how to compile an application with a number of jars on the classpath.
siddharth das
Ranch Hand
Joined: Aug 17, 2007
Posts: 124
posted
0
Which jar file ,I have to set in the classpath.
There are more than one jar files.
All the ones your application requires--not knowing anything about your application I have no way of knowing what you're using. At the very least you need all the Struts dependencies.
Dependency information is available through documentation, btw, and it would almost certainly be faster to look it up than to wait for someone to answer here. Look here and save yourself some time. That's why the documentation exists.
siddharth das
Ranch Hand
Joined: Aug 17, 2007
Posts: 124
posted
0
When I run my struts application.I got the following error.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: File "/xyz" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:404)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154)
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:202)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:460)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:525)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1616)
org.apache.jasper.compiler.Parser.parse(Parser.java:173)
org.apache.jasper.compiler.ParserController.parse(ParserController..java:247)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:149)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:135)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:243)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:459)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
I am developing a simple struts application and deploy it in tomcat server.
The components are
register.jsp
success.jsp
failure.jsp
RegisterAction.java
RegisterForm.java
struts-config.xml
web.xml
The contents in register.jsp
The contents in struts-config.xml
But when I run in tomcat server I got the following exception
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: File "/xyz" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:404)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154)
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:202)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:460)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:525)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1616)
org.apache.jasper.compiler.Parser.parse(Parser.java:173)
org.apache.jasper.compiler.ParserController.parse(ParserController..java:247)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:149)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:135)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:243)
I am not getting the why this exception occured.
Please suggest me.
Thanks,
Siddharth