File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Including a JSP Fragment with JSTL code in it

 
Peter Velosy
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Forum members,

I've run into the following problem, and although I have tried googling and searching through the forums, I didn't find an appropriate answer.

My problem is as simple as this:

I would like to include the following segment in many JSP pages, which displays a login link if the user is not logged in, and a logout link with the username if he is already logged in.



I've put the @taglib directive here too for safety reasons, but it's also there in the page where I'm trying to include this segment with:



However, the main JSP page just reads my JSPF line by line instead of parsing the JSTL code included in it. How can I change the code, so that the JSTL Choose actually gets parsed?

Many thanks,
Peter
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rename the file to .jsp. The .jspf file type should only be used with the include directive, not the include action.
 
Peter Velosy
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, it works! I didn't know about this difference.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Welcome to the Ranch!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic