• 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

static content in JSP  RSS feed

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,

can we include static content in JSP page by using the following?
1.<jsp:include page="/app/first.html" />

2.RequestDispatcher dispatcher =request.getRequestDispatcher("/app/first.html");
dispatcher.include(request,response);


One more question!!
Why cant we use request object in JspContext API.??where as we can use it in PageContext API.
Thnks in advance
shanthisri
[ February 07, 2006: Message edited by: shanthisri mocherla ]
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


can we include static content in JSP page by using the following?
1.<jsp:include page="/app/first.html" />



Yes you can include. But the purpose of <jsp:include> standard action is to include dynamic content. For static content prefer <%@ include file="/app/first.html" %> directive.


One more question!!
Why cant we use request object in JspContext API.??where as we can use it in PageContext API.



I didn't get you here. Are u talking about custom tags (or) in general. By request object do you mean request implicit variable.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
---
2.RequestDispatcher dispatcher =request.getRequestDispatcher("/app/first.html");
dispatcher.include(request,response);

---

Can you specify a static html page in getting the request dispatcher?
 
shanthisri mocherla
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,Vishnu
You are right.I was talking about request implicit object in JSPContext.
I've seen this statement in final coffecram exam in HFSJ.
Thnak sfor your time
Shnathisri
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!