• 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

Action not found on form submit

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
web.xml is :--

 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this 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