Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Action not found on form submit

 
Bhoomika Bathla
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Bhoomika Bathla
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
web.xml is :--

 
Ankit Garg
Sheriff
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic