• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Simple scriplet, does this violate model 2?  RSS feed

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!