• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

why cant we use normal html tags instead of struts html when using struts framework?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a small doubt.. In interviews too they have been asked this question many times.. Could you please tell me "why cant we just use normal html tags instead of struts tags while using Struts framework??" what makes the difference of struts html and normal html tags??

waiting for quick reply...

Harishwar
 
Sheriff
Posts: 9692
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use normal HTML tags like <input type="text" /> in JSP pages when you use Struts. If you use the struts tags, you get certain advantages like validation messages, automatic form fill-up etc...
 
Harishwar Madhya
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote:You can use normal HTML tags like <input type="text" /> in JSP pages when you use Struts. If you use the struts tags, you get certain advantages like validation messages, automatic form fill-up etc...



Thnx Ankit for replying me.. Yeah I agree with your answer.. but i have a small doubt.. whats the diffference between <form> and <html:form> ?? why cant we just use <form> instead of <html:form>? and why cant we use normally <input type="text"> instead of using <html:text> ??


waiting for quick reply..



Harishwar
 
Harishwar Madhya
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
waiting for some replies..
 
Ranch Hand
Posts: 96
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Harishwar,

Did you get your answer to this question?
If no, can anyone please explain this? I know struts html tags automatically populates html fields from form beans, but we can do the same thing using scriptlets, can't we? Is there anything else that these tags do? for eg., if I use normal html, will the framework still make the user input values available in the form bean?
If I do not use these tags, will the framework still work normally and correctly without me having to do any extra work?

Thanks in advance to all for your help

 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Scriptlets should never be used in any JSP page. It's 2013 -- over 12 years (12 years!) after scriptlets were obsoleted by the JSTL and EL.

In any case, using the custom tags provided by the framework to do the work you are thinking of doing yourself with scriptlets (or even with more modern techniques) is the whole point of using a framework. If you don't want that, why would you be using the framework in the first place?
 
Souvvik Basu
Ranch Hand
Posts: 96
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear...thanks for the quick reply. I get the point you are making. But can you please elaborate on which type of work the struts HTML tags do in the back end? As the original poster noted, this sometimes gets asked in the interviews. To what extent exactly will I be losing out on the framework's advantages if I use normal html.
Please provide specific technical functions, if possible (or re-direct to a good source that I can read up).
Thanks again...
 
Bear Bibeault
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For that you'd need to consult the documentation for the framework. Each tag serves a specific purpose.

 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic