This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

basic struts problem

 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone,

i am not a expertise in struts but have the idea about it's flow but that knowlege is not sufficent for me to get of the error i am facing.

the web.xml is


struts-config.xml is


the jsp is


when i click on the upload button i am getting the error that /upload.dav resource is not found, how to overcome this.
 
Krishna Madhava
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In your JSP, please replace the action name as /upload.do instead of upload.dav..

We can call struts actions by *.do not dav..

< body>
<h1>Upload</h1>
<form action="/upload.do"> // /upload.do instead of upload.dav
<input type="file" name="docName">
<input type="submit" value="Upload">
</form>

Hope it will resolve the issue...
 
Krishna Madhava
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I Suggest you to try with struts-html tag libs in your JSP.

<%taglib uri="/WEB-INF/struts-html" prefix ="html"%>

<html:form action=' ...'>

<html:text type=' ' value=' '/>
</html:form>


Note : Kindly keep your struts-html.tld file inside your WEB-INF directory of your application...

 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have placed the url patten in my struts configutation file as *.dav not *.do
 
Jaimesh M Ponkia
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the form action to following:

<form action="<%=request.getContextPath()%>/upload.dav">

Also, don't forget to specify the enctype when using input type as file.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic