• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JSP's & HTML

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've read that a limitation with JSP's is that you have to insert all of the HTML in with the JAVA code. Is there a way to integrate JSP's with HTML generated from an HTML editor such as Dreamweaver? I'm just looking for the easiest way to put the JSP's together.
Thanks,
Mike
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe what u said is not correct and is a fact about servlets. Using jsp we can just use plain html and java code is written within scripting elements
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could actually have a JSP with only HTML in it (but with a .jsp extension) and it would work. So, really, what some people don't like is the mixing of Java directly inside this HTML with scriptlets or expressions. To get around this, JavaBeans can be used in conjunction with <jsp:useBean>, <jsp:getProperty>, and <jsp:setProperty> to move some of the Java syntax out of the JSP and into JavaBeans. Custom tags can also be utilized by writing Java class handlers that incorporate much of the Java functionality that would otherwise have been mixed with the HTML in the JSP.
If you are not worried about maintainability (such as for a class project), it is probably easiest to just write the HTML and incorporate Java where dynamic behavior is needed using scriptlets and expressions.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what you said is true for servlets and not for jsp.
in servlets you have to embed the html tags in your java file.
about jsp you can use html and jsp altogether to give the dynamic effect where you want and static else where.
sachin
 
Mike Cunningham
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I appreciate all the replies. I've primarily used JAVA with a few servlets...so I'm pretty new at it.

Originally posted by Dustin Marx:
You could actually have a JSP with only HTML in it (but with a .jsp extension) and it would work. So, really, what some people don't like is the mixing of Java directly inside this HTML with scriptlets or expressions. To get around this, JavaBeans can be used in conjunction with <jsp:useBean>, <jsp:getProperty>, and <jsp:setProperty> to move some of the Java syntax out of the JSP and into JavaBeans. Custom tags can also be utilized by writing Java class handlers that incorporate much of the Java functionality that would otherwise have been mixed with the HTML in the JSP.
If you are not worried about maintainability (such as for a class project), it is probably easiest to just write the HTML and incorporate Java where dynamic behavior is needed using scriptlets and expressions.


 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic