File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes servlet action is not available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "servlet action is not available" Watch "servlet action is not available" New topic

servlet action is not available

tirapa reddy

Joined: May 05, 2007
Posts: 19
i am new to struts for my first application i got an error "servlet action not available" how resolve this.i sending xml file please suggest me to solve this

<display-name>Struts Blank Application</display-name>

<!-- Standard Action Servlet Configuration -->

<!-- Standard Action Servlet Mapping -->

<!-- The Usual Welcome File List -->


struts-config file::

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config SYSTEM "">


<!-- ========== Form Bean Definitions ============================== -->


<form-bean name="testForm" type="test.ssl.TestForm" />


<!-- ========== Global Forward Definitions ============================== -->

<!-- ========== Action Mapping Definitions ============================== -->

<action path="/te" type="org.students.TEAction">
<forward name="disperror" path="/de.jsp" />
<action path="/test" type="org.students.TestAction" />


action class::

package org.students;
import javax.servlet.http.*;
import org.apache.struts.action.*;

public class TestAction extends Action
System.out.println("object created");
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletRequest response)throws Exception
System.out.println("execute method");

return mapping.findForward("disperror");

[ July 03, 2008: Message edited by: tirapa reddy ]
[ July 03, 2008: Message edited by: tirapa reddy ]
Siddharth Naik
Ranch Hand

Joined: Apr 09, 2006
Posts: 35
How are you calling action from your JSP page?

Also would you please edit your post and use UBB Code to post your code? That way it will be easier for us to read.

Thanks<br />Sid
tirapa reddy

Joined: May 05, 2007
Posts: 19
i am new to struts application .action class job is to the view the jsp.

why it is showing error
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This message indicates that your Struts action servlet did not initialize properly. Look at the System Out log for the time period when the server first started up or when you deployed the application. You should then see one or more error messages with stack traces that will tell you the reason why it couldn't initialize. The most common reason for this is that there may be XML errors in your struts-config.xml file making it so it can't be parsed. If so, you should see a message indicating specifically what is wrong with the file.
[ July 03, 2008: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: servlet action is not available
It's not a secret anymore!