This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

basic struts problem

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have placed the url patten in my struts configutation file as *.dav not *.do
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic