• 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

struts2 url mapping issue with servlet

 
Greenhorn
Posts: 25
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All, Greetings !!

i have to use servlet in my struts 2 based application for some specific purpose, now i have mapped the servlets in web.xml and its working fine.
now i have to use filterdispatcher for all the other requests but then the problem is with servlets,

i went though may posts and i found something useful like

add this to struts.xml


and change the web.xml like


i went through a few pdf as well and i try to understand how these constant tags work..but no luck..i dint get it.

please help me to make my servlets work with strust2 .

Thanks in advance !
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, since this appears to be about Struts, let's move it to the Struts forum.

And it would help if you could edit your post so that it actually asks a question. Or provides some information about a problem you are having. As it stands, there isn't anything there which can really be answered.
 
satnam singh negi
Greenhorn
Posts: 25
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:First of all, since this appears to be about Struts, let's move it to the Struts forum.

And it would help if you could edit your post so that it actually asks a question. Or provides some information about a problem you are having. As it stands, there isn't anything there which can really be answered.




the problem was url pattern ,that was conflicting with servlet url pattern..the scenario i posted there,were actually itself a solution when i tried them with my code.
its resolved now.thanks for the responses paul .
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Satnam,

I have faced this issue and it resolved i have done the following:

web.xml:
<servlet>
<display-name>ProfileDetails</display-name>
<servlet-name>ProfileDetails</servlet-name>
<servlet-class>com.user.ProfileDetails</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ProfileDetails</servlet-name>
<url-pattern>/ProfileDetails.xyz</url-pattern>
</servlet-mapping>


struts.xml:

<constant name="struts.action.excludePattern" value="/ProfileDetails"/>



jsp:


<form name = "myForm" method="post" action="ProfileDetails">

I think it will be helpfull.

 
reply
    Bookmark Topic Watch Topic
  • New Topic