Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static content in JSP

 
shanthisri mocherla
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 ]
 
Vishnu Prakash
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.
 
Ravi Appana
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic