• 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

Jsp in Struts

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi :

I would like to know if a jsp page to be used in struts framework should always be developed using struts custom tags.Cant we use the normal jsp pages ??

Thanks
Venkatesh
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I don't know the "correct" answer to that question so this is only my opinion...

I found the great thing about struts is that it reduced the complexity of jsps especially when it came to retrieving information from and displaying information on a web page. I find the simplicity of it beautiful (ok, I'm a geek)!

Lets look at a textfield in a jsp.. Using the struts tags you would code the following:
<html:text property="formVariable" size="15"/>

If you wanted to display a value, its a simple case of in your action typing
aForm.setFormVariable("My Value");
And Voila! "My Value" is displayed in the textfield... and if someone enters a value then in you simply need to type (in ur action):
String theEnteredValue = aForm.getFormVariable();

How simple is that!!! Ok, so you do need to do some extra things like add the form and action to the struts-config, specify what is associated with a particular jsp and ensuring all your variables are in your form class - but personally, it just makes my life a whole lot easier which means I get extra time to surf the net at the end of the day

And its especially great when you initialise your form with a Value Object or export a Value object from your form so that you don't have to initialise each variable in the object!

Ok, thats my 2 cents!
K
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, AFAIK it is not mandatory to develop your JSPs using Struts though you would be not utilizing it 100% .You can as well use normal JSP tags with Struts framework.
Any Comments ??

Thanks,
Priya
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic