*
The moose likes IDEs, Version Control and other tools and the fly likes Action Classes (Struts) with Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Action Classes (Struts) with Eclipse" Watch "Action Classes (Struts) with Eclipse" New topic
Author

Action Classes (Struts) with Eclipse

Michael Bieniek
Greenhorn

Joined: Mar 11, 2009
Posts: 1
Hi all,

I'm trying to deploy a simple web app with Tomcat and using the Sturts 1 framework.
I'm using the latest Eclipse (3.4.x) as my IDE.

I've created a Tomcat project and imported a sample Struts war file to start.

I've created a simple JSP under <workspace>/<project>/pages/ called login.jsp. The index page redirects to the login page
via <logic:redirect forward="login"/> with all appropriate struts-config xml configurations.

Hitting the page, i.e. localhost:8080/<projectname> shows my login page just fine.
and under action mappings I had:
<action
path="/login"
forward="/pages/login.jsp"
</action>

But when I add the subsequent attributes to have login page call my LoginAction class when I leave via submit button, I get loading the page

<action
path="/login"
forward="/pages/login.jsp"
type="LoginAction"
name="LoginForm"
scope="request"
validate="true"
input="/pages/login.jsp">
<forward name="success" path="/pages/success.jsp"/>
<forward name="failure" path="/pages/failure.jsp"/>
</action>

The error is a HTTP 500 error:
javax.servlet.ServletException
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I've been slaving over this seamingly simple problem for a long time and I can't figure it out.
My action forward class LoginAction and my action form class LoginForm or both proper action / form classes respectively.
They are located in Eclipse under: <ProjectName>/src/ in Package Explorer.

If anyone knows anything about this problem, your help is greatly appreciated.

Thanks again,

Michael

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Action Classes (Struts) with Eclipse
 
Similar Threads
Getting null pointer Exception
Exception in ForwardAction
NullPointerException, can not able to access ActionForm data inside execute() metod of Action class
how will arrange in the action mapping in the strut-config.xml?
Doubt in Action messages