• 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
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Can we apply struts tag libraries like struts-html.tld to a servlet file?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we apply struts tag libraries like struts-html.tld to a servlet file?

It means that form can be constructed with struts tag libraries and it submit the request to ordinary servlet file by putting servlet name in form tag instead of action class.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could use the <bean:xxx> and <logic:xxx> tags, but you couldn't use the <html:xxx> tags. An <html:form> tag must declare a Struts Action in the action attribute, and all other <html:xxx> tags must be embedded in a valid <html:form> stanza.

If you tell us what it is you're trying to accomplish, we may be able to help you find a work-around.
 
arulraj michaelraj
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In form tag, we can give servlet name instead of struts action class by using action attribuge....


Really i don't know whether it will work.... just i am asking ... i didn't try the above one......
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can specify a servlet as action in a regular <form> tag, but you can't do so in an <html:form> tag. Struts will throw an exception. If you don't believe me, try it.

If you have a Servlet that you need to call in a Strut application, the solution that comes to my mind is to take the logic you need from the Servlet and put it into an Action class. An Action class can do anything a servlet can do.
[ March 12, 2007: Message edited by: Merrill Higginson ]
 
"To do good, you actually have to do something." -- Yvon Chouinard
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic