• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

servlet action is not available

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
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

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

<!-- Standard Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>


<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>


struts-config file::


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

<!DOCTYPE struts-config SYSTEM "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">

<struts-config>

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

<form-beans>

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

</form-beans>

<!-- ========== Global Forward Definitions ============================== -->
<global-forwards>
</global-forwards>


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

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

</action-mappings>
</struts-config>


action class::


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

public class TestAction extends Action
{
TestAction()
{
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 ]
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
tirapa reddy
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am new to struts application .action class job is to the view the jsp.

why it is showing error
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Are we home yet? Wait, did we forget the tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic