This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

is EL can be used in an included header jsp file?  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, everybody!

I have something I don't understand. Please help me. Thanks a lot.

The scenario is:

"Head.jspf" is included in "Contact.jsp"
<img src="images/Web-Services.jpg"><br>
<em><strong>${paramValues.subTitle}</strong></em><br>

"Footer.jspf" is included in "Contact.jsp"
<a href="index.html">home page</a><br>
${param.email}

"Contact.jsp" includes "Head.jspf" and "Footer.jspf"
<html><body>
<jsp:include page="Header.jspf">
<jsp : param name="subTitle" value="We take the sting out of SOAP." />
</jsp:include>
<hr><br>
<em>We can help.</em><br><br>
<br><hr>
<jsp:include page="Footer.jspf">
<jsp: param name="email" value="likexuan1996@yahoo.com" />
</jsp:include>
</body></html>

load "Contact.jsp" on my tomcat5, I just got:
${paramValues.subTitle}
We can help.
home page
${param.email}

The problem is those ELs in my Header.jspf and Footer.jspf don't work.

Anybody can help me? Thank you very very much!

[ December 17, 2005: Message edited by: YuYu LiLi ]

[ December 17, 2005: Message edited by: YuYu LiLi ]
[ December 17, 2005: Message edited by: YuYu LiLi ]
 
YuYu LiLi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I just got it.
If you want to use EL in a jsp page which is going to be included in other jsp pages, you must not name it like *.jspf. You should name it like this way: *.jsp. That's it.
 
Marshal
Posts: 67226
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The .jspf file type should only be used for files included with the include directive, not files included with the include action.

In the former case, the file becomes part of the original jsp and is processed with the parent. In the latter case, it is processed separately, and so changing the file type to something other than .jsp will prevent the file from being processed.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!