This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Struts and the fly likes Action not found on form submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action not found on form submit" Watch "Action not found on form submit" New topic
Author

Action not found on form submit

Bhoomika Bathla
Ranch Hand

Joined: Nov 28, 2009
Posts: 40
hello friends...

This is my index.jsp:-

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

<html:form action="/DisplayAction" >
Enter Userid:<html:text property="userid" /><br/>
<html:submit/>
<nested:present property="userid">
<nested:equal property="userid" value="1">
You are Bhoomika
</nested:equal>
</nested:present>

</html:form>

and this is the content of struts-config.xml :-

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

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<!--
This is the Struts configuration file for the example application,
using the proposed new syntax.
-->


<struts-config>
<data-sources>
<data-source type="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
<set-property
property="driverClassName"
value="com.mysql.jdbc.Driver" />
<set-property
property="url"
value="jdbc:mysql://localhost/User" />
<set-property
property="username"
value="root" />
<set-property
property="password"
value="" />

</data-source>
</data-sources>
<form-beans>
<form-bean name="displayForm"
type="form.DisplayForm"/>
</form-beans>



<action-mappings>
<action path="/DisplayAction"
type="action.DisplayAction"
name="displayForm"
scope="request"
validate="false"
>
<forward name="display" path="/jsp/index.jsp" />

</action>
</action-mappings>

</struts-config>

I have created DisplayAction.java in action package and DisplayForm in form package .But when i submit form it says ServletAction not Found.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9327
    
  19

Bhoomika please Use Code Tags when you post a source code. That way your code looks formatted. Unformatted code is hard to read. You can add code tags by wrapping your code in [code] [/code] tags. You can edit your message using button and then add code tags to it...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bhoomika Bathla
Ranch Hand

Joined: Nov 28, 2009
Posts: 40
Bhoomika Bathla wrote:hello friends...

This is my index.jsp:-


and this is the content of struts-config.xml :-



I have created DisplayAction.java in action package and DisplayForm in form package .But when i submit form it says ServletAction not Found.
Bhoomika Bathla
Ranch Hand

Joined: Nov 28, 2009
Posts: 40
Bhoomika Bathla wrote:hello friends...

This is my index.jsp:-


and this is the content of struts-config.xml :-



I have created DisplayAction.java in action package and DisplayForm in form package .But when i submit form it says ServletAction not Found.

[AG: Indented the Code]
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9327
    
  19

Were there any deployment errors in your app (due to the datasource or something else)?? How did you configure struts in web.xml?? Did you put the struts jar files in the lib folder of your application??
Bhoomika Bathla
Ranch Hand

Joined: Nov 28, 2009
Posts: 40
web.xml is :--

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9327
    
  19

Ankit Garg wrote:Were there any deployment errors in your app (due to the datasource or something else)?? How did you configure struts in web.xml?? Did you put the struts jar files in the lib folder of your application??

You didn't answer these questions. I can't see any problems in the configuration files...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Action not found on form submit