Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Common HEADER and FOOTER in JSP  RSS feed

 
David Wei
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have done some web applications using JSP on IBM WebSphere App. Server. Recently I am thinking whether I can just create a common jsp files for HEADER and FOOTER, and each application can just use the same files. But for my understanding, the "include" tag in JSP can only include some files using relative URL, so I can not use files which are outside of the current application (in WebSphere, it refers to the application host name). The initial idea is if I can use this structure, so I can change the content in the HEADER and FOOTER once, any application which uses those files will be changed as well.
Can anybody give some suggestions on this? Thanks a lot.
David
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi david
if u r on Unix how about using symbolic links OR hard links from ur context to the actual file path?
regards
maulin
 
David Wei
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply, maulin.
But I am writing the applications on Windows. Do you have any idea? or someboday can help me on this. Thanks,
David
 
farhy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
why dont you use Style Sheets in HTML, that
should do your work.
so long
farhy
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi dear
one more thing...u can write your header/footer in diff. html like header.html, footer.html.
now u can make them with "File" object, & read with a FileReader & write it in a JSP file

hth
MB.
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or check out the import tags that are a part of the JSP Standard Tag Library.
Regards
Simon
 
David Wei
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Simon,
Thanks for your answer to my question posted on Oct. 8. I would like to try to use import tags from JSP Standard Tag Library. Before I start, I want to ask you one more question.
Since I am using IBM WebSphere Application Server 3.5, do you know it has had included the JSP Standard Tag Library? or how about version 4.0?
Thanks a lot.
David
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSTL is available as a separate download and isn't bundled with WebSphere. To use JSTL, you will need a server that supports Servlet 2.3/JSP 1.2 and I'm pretty sure that this rules out both the versions of WebSphere that you've mentioned.
Anybody know any different?
Simon
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!