• 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

one jsp design question

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is this design:



My two doubts are:

1. We use include, when we want other JSP to do some functionality in between, but here we are not doing much (just making style)...

2. We are not using those styles in any of the JSP that include included.jsp...

Please suggest.

Thanks.

[ June 05, 2006: Message edited by: rathi ji ]
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There was a mistake in my previous post. I was including wrong file. But now I have corrected my post.

Any idea???

Thanks.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is your question ?

Anyway, having a <html> tag in the include file does not seem to be a good idea.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Satou kurinosuke:
What is your question ?

Anyway, having a <html> tag in the include file does not seem to be a good idea.



Thanks Satou.

But the major concern is:

1. We use include, when we want other JSP to do some functionality in between, but here we are not doing much (just making style)...

2. And strange part is, we are not using even those styles in any of the including JSPs (that include included.jsp)...

What could be the reason for this?

Thanks.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems to be a bad way to use include files.
Using h1/h3 or not is not a problem. You want to include this common file in all your jsps, whether you're using h1/h3 or not. So I'm not concerned about number 2.

What I don't like is defining a html and header tag in the include file.
The purpose of this include file may be to apply the same stylesheets to all jsp pages. I think this is a bad way to do it. Better use a separate css file and link to it in each jsp page.
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have u thought about using templates?

http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Satou kurinosuke:
It seems to be a bad way to use include files.
Using h1/h3 or not is not a problem. You want to include this common file in all your jsps, whether you're using h1/h3 or not. So I'm not concerned about number 2.

What I don't like is defining a html and header tag in the include file.
The purpose of this include file may be to apply the same stylesheets to all jsp pages. I think this is a bad way to do it. Better use a separate css file and link to it in each jsp page.



Thanks Satou,
Actually, that's just my mistake and actual included.jsp file doesn't have html and head tags...

And one more thing is, all including.jsp files has *CSS including* code also. I mean, all files are including this included.jsp as well as some CSS.



Can you tell me, any specific disadvantage of using 'include' for styles???

Thanks.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Can you tell me, any specific disadvantage of using 'include' for styles?


I'm not sure there is a particular disadvantage. But using a <link> tag pointing to a css file seems a better way to separate css from jsp.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Satou kurinosuke:

I'm not sure there is a particular disadvantage. But using a <link> tag pointing to a css file seems a better way to separate css from jsp.



As I said, all files are pointing to some CSS... and including this JSP also (included.jsp)...
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by rathi ji:


As I said, all files are pointing to some CSS... and including this JSP also (included.jsp)...



Ohh..now I got it...

Actually, we are setting some styles based on one dynamic parameter (getting that parameter in included.jsp from request and then setting some styles on the basis on this)...

Thanks All.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's not much point to put them in an included jsp file then.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Satou kurinosuke:
There's not much point to put them in an included jsp file then.



Can we have dyanamic CSS??? I mean, it chnages based on some request parameters...


 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depending on which JSP include tag you're using you will either have to recompile ALL JSPs whenever the stylesheet changes or will have to process a JSP that isn't for each page request.

Far better to just link each page to a CSS file.

No, you can't have dynamic styles. But you can dynamically decide which style to use which is the next best thing.
Just make several styles in the CSS file and decide in the JSP which to use based on whatever.
reply
    Bookmark Topic Watch Topic
  • New Topic