• 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

Simple scriplet, does this violate model 2?

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess I'm getting addicted to EL and JSTL that I don't want to see this kind of style in my page. But does putting these line of codes in my page violate any of the model 2 principles?


 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Although, its all about view but its not fabricating the view. I think this code snippet should be in your controller.
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,
If you want to set these headers for a Specific JSP or even for all responses as such , I think using Output filters is a right choice. Correct me if i am wrong.
Code will be much more modular.

Shrinivas
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might try the HTML equivalent:

<meta http-equiv="Cache-Control" content="No-cache">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="No-cache">
<meta http-equiv="Cache-Control" content="no-store">
<meta http-equiv="Cache-Control" content="max-age=0">
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all for your reply!


Although, its all about view but its not fabricating the view. I think this code snippet should be in your controller.



I don't have a front-controller for some of my JSP's. Would c:import be sufficient?




Is this cross-browser compatible?




If you want to set these headers for a Specific JSP or even for all responses as such , I think using Output filters is a right choice. Correct me if i am wrong.
Code will be much more modular



I'm not familiar with Output filters... I'll try to google that... Thanks!
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Filters are nothing but just a compliment to servlet. Doing it through filters worth it. For me filters is a kind of must for a java web developer. Its simple and easily digestable.

You said for some of your JSPs you are not using controller. Does it mean those are not following Model2?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For Http meta tag you can refer to W3Schools or google it to find browser compatiblity.
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


You said for some of your JSPs you are not using controller. Does it mean those are not following Model2?




There are pages that I think will not be needing the help of a controller such as the "About Us" page. Although, I try to create another JSP and include that to my About Page just in case I need to change something. Thank you for your help!
 
reply
    Bookmark Topic Watch Topic
  • New Topic