page « Include « JSP-Servlet Q&A

1. How can I include a servlet in a jsp page?

is it possible to include a servlet in a jsp page? if so how?

2. How do I include jsp pages in a Java web app without duplicating code?

Let me just start out by saying I am completely new to Java web apps, so I'm sorry if this is a very basic question. I am writing an app that has ...

3. Include a JSP in Lotus web page

is there a way to include a jsp page (what it returns) into a lotus web page ? What I'd need is the equivalent of a <jsp:include url="...."> but to use on ...

4. Including JSP page inside forEach loop

I need to do for each loop and include loops content to other jsp page. Now I need to pass looped variable to other JSP page. I have tried following, but ...

5. how to use the same object instance in main jsp page and jsp:included files as well?

I have a jsp that uses a 'counter' (Integer) object to keep track of the various pieces of the page that are displayed. There are three major sections of the page, ...

6. Including a JSP Page Programatically

I need to include a JSP page in a Tag class. I believe the standard way to include a JSP page within another JSP page using API is this:

request.getRequestDispatcher("included.jsp").include(request, response);
However, I ...

7. include extenal java script file in jsp page

I have an external JavaScript file named paging.js. Following are the contents of the file:

function Pager(tableName,itemPerPage){
    this.tableName = tableName;
    this.itemPerPage = itemPerPage;

8. What is the difference between and <%@ include file = ... >?

Both the tag includes the information from one page in another. what is the exact difference between these two tags????

9. Including page from other server !!!

Hi, I have a problem calling a serverpage from other server. The JSP Code : File name : jsp1.jsp : The above JSP file "jsp1.jsp" is in Weblogic Commerce Server and is called with address : "http://content:7501/jsp1.jsp" If I am replacing the above link in the "jsp1.jsp" with the one in the same port as the "jsp1.jsp", it ...

10. Including a page

11. Weird problems in page when using nested includes in my JSP.

Hi I've got a jsp that uses a taglib and this taglib does a pagecontext.include("blah.jsp") to display information. When I run this .jsp the file contained inside the "blah.jsp" is ALWAYS are the top of my page and the remainder of the jsp follows. So the information is always fisplayed as "taglib info", leftMenu.jsp, footer.jsp instead of leftMenu.jsp, 'taglib info', footer.jsp ...

12. difference bw jsp: include page and @ include file

I have a main jsp file that redirects, depending on the request, the appropriate jsp file. I was using at first: <%@ include file="d_AllProjects.jsp"%> But I started getting the "Illegal target of jump or branch" error once I had more than 17 includes (using condition to select the appropriate one). so I switched the code to build the filename as a ...

13. Including a JSP page from a different Web Application

Well, I am using JRUN 4, development version and I reproduced the strange behavior. I even simplified the problem statement, you don't have to include a file from another web app. Problem: The call to RequestDispatcher.include() is producing two odd behaviors: 1. after return from rd.include(), the response.isCommitted() is "true". That baffles me. How did the committed status get set to ...

14. which include to use page or file

Which of the below is better to use on a web site. I would have 3 includes on each page,- and would be the same for each page. ie. a header, footer, and left nav. <%@ include file="this.jsp"%> Is the below correct? tag which is processed at runtime, and <%@ include %> tag which is prcessed ...

15. include page directives

16. Including Servlets to JSP page

Include directive: Mandatory attribute file missing at org.apache.jasper.compiler.DefaultErrorHandler.jspError( at org.apache.jasper.compiler.ErrorDispatcher.dispatch( at org.apache.jasper.compiler.ErrorDispatcher.jspError( at org.apache.jasper.compiler.JspUtil.checkAttributes( at org.apache.jasper.compiler.Validator$ValidateVisitor.visit( at org.apache.jasper.compiler.Node$IncludeDirective.accept( at org.apache.jasper.compiler.Node$Nodes.visit( at org.apache.jasper.compiler.Node$Visitor.visitBody( at org.apache.jasper.compiler.Node$Visitor.visit( at org.apache.jasper.compiler.Node$Root.accept( at org.apache.jasper.compiler.Node$Nodes.visit( at org.apache.jasper.compiler.Validator.validate( at org.apache.jasper.compiler.Compiler.generateJava( at org.apache.jasper.compiler.Compiler.compile( at org.apache.jasper.JspCompilationContext.compile( at org.apache.jasper.servlet.JspServletWrapper.service( at org.apache.jasper.servlet.JspServlet.serviceJspFile( at org.apache.jasper.servlet.JspServlet.service( at javax.servlet.http.HttpServlet.service( at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at org.apache.catalina.core.ApplicationFilterChain.doFilter( at org.apache.catalina.core.StandardWrapperValve.invoke( at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext( at org.apache.catalina.core.StandardPipeline.invoke( at org.apache.catalina.core.ContainerBase.invoke( at org.apache.catalina.core.StandardContextValve.invoke( at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext( at ...

19. Include page to div

22. include page ...problem

Hi, I am not able to figure out this .. In the jsps of my application ...I check for session at the beginnig of the page.. if it is null...redirect the user to a page ..saying Invalid session... This was working fine in my local(Tomcat) and remote (WAS 5.1) since there was a duplicity of code,this session checking code was moved ...

23. include jsp page in servlet

24. Can I include a jsp page in servlet

25. How to include jsp page

29. How to include errorpage in xhtml page.

31. Having problem to include clock in jsp page

I am making an online exam application by using Jsp and Servlets. What I want to do is clock should start when exam begins and on submitting question and going to next question clock should not get reset I tried using frameset by keeping clock related data in another page and question in another but the problem is that it divides ...

32. How do I include a jsp page

I am assuming you have a war with WebApps name. (If you are using tomcat, don't get confused with WebApps folder, this i don't mean). So whenever you want to include any jsps, then you can use the relative path to access them. In your case as suggested in earlier posted, use