Exception in Loading Images in JSP pages

Hi All,
I am trying to load an image many number of times(to create a sort of graph).
I am using Buffered Image & Graphics.drawImage().Still when my page loads I can see only the lines I draw btween the images but not the images.The images are seen only on refresh.
I get Illegal State Exception ServletHttpResponse.getWriter().
Can anyone help me with this at the earliest
THANKS

Hi,
Here is part of my code:
image= new BufferedImage(1000,img_height, BufferedImage.TYPE_INT_RGB);
grph=image.getGraphics();
Then in for loop i execute the following ,changing the co-ordinate,required no of times.
grph.drawImage(myImage,xCord,yCord,xBlock,yBlock,null);
Finally I do this:
ServletOutputStream out1 = response.getOutputStream();
JPEGImageEncoder encoder= JPEGCodec.createJPEGEncoder(out1);
encoder.encode(image);
The page that has this code is called by another jsp in the image tag.<img src="drawimage.jsp">
Please Reply

Similar Messages

  • How to display uploaded image in jsp page.

    Hello,
    I am using struts 1.2.9 and and have uploaded image on the server. Now what I want to do display the image in jsp page after clicking on one link in jsp. I have tried many thing to display image in jsp page. But I am getting an error during displaying image in jsp. I have displayed absolute path in servlet. and used InputStream and outputstream to display image in jsp page.
    Can any one help.
    Thanks in advance
    Manveer Singh

    Follow this. This topic is very popular recently on the forum.

  • Display image on jsp page

    I have to display image on jsp page with some text output. This image is already saved at a location parallel to web-inf and is generated dynamically using a servlet. I have used img tag html to display the image. Other outputs are taking their values from database.
    First problem is that image will be taking time to display in comparision of other outouts from database. I have to refresh the page to get imageon my page.
    Second is that if I save image in a folder parallel to web-inf in my project then it will not be displaying the image.
    Can I use any jsp functionality to display image with other outputs from database. I have used "*include*". but it shows only that image and other outputs.

    Best way is to use a servlet for this.
    <img src="path/to/imageservlet?id=someidentifier">
    <!-- or -->
    <img src="path/to/imageservlet/someidentifier">In the servlet's doGet() just write code which gets an InputStream of the image (either directly generated, or just read from the local disk file system, if necessary with help of ServletContext#getRealPath(), or even from the DB by ResultSet#getBinaryStream()) and writes it to the OutputStream of the response. That's basically all. Don't forget to buffer the streams properly to speedup performance and to save memory.
    You can find here a basic example: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • Problem in displaying image on jsp page

    I want to display an image on jsp page.I copied the image the image in WebContent folder.
    I am able to see the image on the design pane when using the following code:-
    <img src="/image.gif" height="50" width="50"> but when i run it in the browser nothing gets diplsyed.
    also when i use the image container and select the source option that image is not displayed in the WebContents file..plz help.

    Hi,
    Seems that the Problem is there with the way how you specifuied the Image relative Path:
    You have specified the below: The opath of image starts with (/) forward slash:
    *<img src="/image.gif" height="50" width="50">*
    It means to access this Image WebLogic Container will form a Path like this:
    http://localhost:7001/image.gif
    BUT may be the image is available inside your Context root: So Change the <Img> tag like following in your JSP:
    *<img src="image.gif" height="50" width="50">*
    (*NOTE:* Never Start your src path with a Preceesing /)
    Now WLE will consider the path like below ..if your Applications Context root is "TestApp"
    http://localhost:7001/TestApp/image.gif
    I am Assuming that Inside the TestApp Application "image.gif" And "your.jsp" jSP pages are Co-Located (Means available in the Same Directory).
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Magical Stuff)

  • Firefox not loading images on certain pages

    All of a sudden, Firefox no longer loads images on certain pages. I updated to 32.0.3. yesterday so thought that was the problem. I uninstalled and reinstalled 32.0.3. but that didn't help. I deactived the add-ons, but that didn't help either. I then installed FF 31, but the problem persists. I don't have the problem with Safari.
    I'm lost ….
    P.S. I had to upload the image via Safari, didn't work via Firefox

    Your System Details list shows that you were only allowing images from the originating page and were blocking third-party images hosted on other servers.
    *permissions.default.image: 3
    These days a lot of sites store content on other dedicated servers, so it is best to leave such a setting at its default of 1 to allow all images.

  • ADF BC:Displaying Image On JSP page

    Hai All
    I'm using ADF BC and JDev 10.1.3.
    I want to show an image on my jsp page from database.
    For this I have written an servlet with the following code
    response.setContentType("image/gif");
    OutputStream os = response.getOutputStream();
    String amDef = "package.AppModuleName";
    String config = "Configuration Name";
    ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
    ViewObjectImpl vo =
    (ViewObjectImpl)am.findViewObject("ViewObject"); // get view object (the same as used in the table)
    System.out.println("vo:" + vo);
    vo.executeQuery();
    Row row = vo.first();
    BlobDomain image = (BlobDomain)row.getAttribute("field");
    //System.out.println("image:" + image);
    InputStream is = image.getInputStream();
    // copy blob to output
    byte[] buffer = new byte[10 * 1024];
    int nread;
    while ((nread = is.read(buffer)) != -1)
    os.write(buffer, 0, nread);
    os.close();
    Configuration.releaseRootApplicationModule(am, false);
    This servlet working perfectly.The image is displayed on the page while running
    the servlet alone.
    My problem is the image is not got displyed on the jsp page
    I tried following code to call the servlet
    <af:objectImage source="ImageServlet"/>
    <img src="ImageServlet" width="140px" height="50px" align="right">
    Where ImageServlet is the url-pattern in the web.xml for the servlet
    Both method are not working
    Any body please help me.......
    what I'm missing..............
    Is there any other way to display an image on JSP page using backing bean
    method.
    Thanks
    Ans

    HI,
    See: http://kuba.zilp.pl/?id=241
    Kuba

  • Help! Errors seen during loading of a jsp page.

    Hi all,
    I'm a newbie in Tomcat and Jsp, whenever my jsp page loads, all these weird errors appeared, the 2Ballpoint_Pen.jpg image with the IOException actually existed.
    What does the rest of the errors mean? How do I fix them?
    Does all errors actually hangs my Tomcat? There's actually quite alot of such similar errors.
    I'm using Tomcat 3.3.1 and JDK 1.3.1_04.
    Please help me....
    2003-08-12 02:15:22 - Ctx(/osrs) : IOException in R( /osrs + /upload/2Ballpoint_Pen.jpg + null) - java.net.SocketException: Connection aborted by peer: socket write error
    at java.net.SocketOutputStream.socketWrite(Native Method)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:91)
    at org.apache.tomcat.modules.server.Http10.doWrite(Http10.java:436)
    at org.apache.tomcat.modules.server.HttpResponse.doWrite(Http10Interceptor.java:480)
    at org.apache.tomcat.core.OutputBuffer.realWriteBytes(OutputBuffer.java:188)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:360)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:338)
    at org.apache.tomcat.util.buf.IntermediateOutputStream.write(C2BConverter.java:234)
    at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:225)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:239)
    at org.apache.tomcat.util.buf.WriteConvertor.flush(C2BConverter.java:183)
    at org.apache.tomcat.util.buf.C2BConverter.flushBuffer(C2BConverter.java:126)
    at org.apache.tomcat.core.OutputBuffer.realWriteChars(OutputBuffer.java:337)
    at org.apache.tomcat.util.buf.CharChunk.flushBuffer(CharChunk.java:388)
    at org.apache.tomcat.core.OutputBuffer.flush(OutputBuffer.java:314)
    at org.apache.tomcat.core.OutputBuffer.close(OutputBuffer.java:305)
    at org.apache.tomcat.core.Response.finish(Response.java:271)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:838)
    at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
    at java.lang.Thread.run(Thread.java:479)

    My codes are:
    <%
    String imagePath2 = JSPHelper.NOPIC_PATH;
    product = null;
    try
         product = (Product)list.get(count);
         imagePath2 = Validation.getImagePath(product.getImage2());
    catch(Exception e){}
    if(product != null)
    %>
    <img src="<%=imagePath%>" width="120" height="125" alt="For loose items, please collect it personally from General Office" style="cursor=hand" onClick='window.open("Image_view.jsp?id=<%=imagePath2%>","","width=640,height=480,")'>
    <%
    %>
    ----------------------------------------------------------------------

  • PLEASE HELP!!! using servlet to generate an image in jsp page

    Hi,
    I am so stuck on this... please help.
    I have a servlet that generated a gif image dynamically. It uses a bean that stores the gif image in a byte array.
    The servlet outputs the byte data to the output stream. The code is really simple and looks like this:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            //HttpSession session = request.getSession();
            try {
                ServletOutputStream stream = response.getOutputStream();
                ImageByteInformation imageByteInfo = (ImageByteInformation) request.getAttribute("imageByteInformation");
                response.setContentType("image/gif");
                response.setContentLength(imageByteInfo.getByteData().length);
                stream.write(imageByteInfo.getByteData(), 0, imageByteInfo.getByteData().length);
                stream.flush();
            }catch( Exception e){   
                System.out.println("You are hooped!: " + e.getMessage() + " " + e.toString());           
            }When I redirect from the dispatch servlet straight to this servlet an image shows up in the browser window.
    However when I try to use this jsp page to display the image nothing happens...
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h2>Hello World!</h2>
            <img src="servlets/Map24ImageDisplayServlet"/>
             //I also tried src/servlets/Map24..., /src/servlets/Map24..., /display, servlets/display
            <h2>Did you see the image?</h2>
        </body>
    </html>My web.xml is here if it helps...
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      <display-name>HelloProject</display-name>
    <servlet>
        <display-name>ServletDispatcher</display-name>
        <servlet-name>ServletDispatcher</servlet-name>
        <servlet-class>servlets.ServletDispatcher</servlet-class>
      </servlet>
      <servlet>
        <display-name>Map24ImageDisplayServlet</display-name>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <servlet-class>servlets.Map24ImageDisplayServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>ServletDispatcher</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
      <error-page>
        <error-code>404</error-code>
        <location>/404_error.html</location>
      </error-page>
      <servlet-mapping>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <url-pattern>/display</url-pattern>
      </servlet-mapping>
    </web-app>I can never get an image to come up. In fact I can never get the jsp page to run the servlet at all! HELP!!! What am I doing wrong?
    Thanks
    Edited by: Kind_of_Green on May 5, 2008 3:55 PM
    Edited by: Kind_of_Green on May 5, 2008 4:00 PM

    OK... so you WERE absolutely right about the src path for the image tag.
    However I also had another problem that was quite a bit more insidious and mostly just a symptom
    of how little I know about what goes on under the hood of a web app.
    My bean storing the image info was stored as a request attribute. When the servlet was called from the
    jsp page the request object was either reset or just never initialized. Anyway it is not the same request
    object I assumed it was being passed in the doGet method. I added my bean as a session
    attribute and everything is sparkly :)
    I can only assume that when a request is neither forwarded nor included (as is the case with
    calling the servlet from the img tag) it is disappeared.
    Anyway, thanks a mint man. I so totally appreciate your time.
    Ciao :)

  • Loading Image from HTML page into Flash component

    Ok, after doing much research on the internet, I am pretty
    sure you have to be a Flash and Actionscripting Jedi in order to
    solve this issue. Here we go:
    I have created an HTML page using PHP and MySql that displays
    image thumbnails. When a user chooses and clicks on one of the
    thumbnails, I want the larger image to be loaded into my swf. It is
    a jigsaw puzzle component I picked up here: www.crifano.com. Here
    is the puzzle on my page with an image manually inserted using
    Flash 8 (Note: This is only working in Internet Explorer right now,
    for whatever reason):
    http://premieretans.com/puzzle/jigsaw.php.
    I want the image on this page to be chosen by the user from a
    number of images that are populated on a regular PHP/HTML page from
    a MySql database. What is the best way to go about this?
    Thanks so much for the help on this matter. I know I am not
    the only person who has run into this dilemma, so I hope your
    knowledge will save others with a similar problem the hours I have
    spent on this issue myself. Thank you!
    Cheers-
    Charles

    Hi,
    There's no direct support for this. But you could implement
    drag and drop the way you normally would in javascript. Except
    here, on mouseUp over a div encapsulating the object or embed tag
    (the flash object), you'll need to make a call into actionscript
    from javascript indicating that a drag and drop happened.
    For more info, see
    how
    to drag and drop using javascript and
    actionscript
    and javascript communication

  • Problem in loading images in JSP

    Hi
    My JSP page is loading few gif images.
    I am running tomcat 4 connected to apache 1.3.22 using MOD_WEBAPP connector.
    My JSP file loads perfectly alright when I load it directly from tomcat server that is port 8080.
    But when I load it from apache that is port 80, it is taking very long time and not loading images.
    Does anybody has (or had ) the similar problem?
    Please help me
    Thanks
    Raji

    I'm having the same problem displaying images when I call a jspt hrough Apache 2.0.39 from Tomcat 4.1.3.
    I am using mod_jk as my connector through Apache.
    Did you come up with a solution to displaying images when calling your JSP app through Apache?
    Thanks
    Lenny Sorey

  • Exception when URL connects to JSP page

    Hi All,
    I have a Web Application [http://localhost:8080/MyWebApps/TestEnv]
    Consider the following 3 pages:
    index.jsp
    Login.jsp
    LoggedIn.jspI have clean & build and Undeploy & Deploy it (NetBeans and using glassfish)
    Start -> Run -> [http://localhost:8080/MyWebApps/TestEnv/]
    will load the index.jsp, redirect to Login.jsp,
    I give a valid userName & password (submit the form),
    reload Login.jsp and it redirects me to LoggedIn.jsp.
    I have created a class that passes the same url to its loadURL method
    but the openStream method of the URL class gives an IOException
    Please tell me how to fix my problem I am baffeled as to the solution
    Below I have provided the code
    Thanx in advance

    index.jsp
    <HTML>
      <BODY>
    <%
        response.sendRedirect("Login.jsp");
    %>
      </BODY>
    </HTML>Login.jsp
    <HTML>
      <BODY>
    <%
        String uName = null;
        String uPass = null;
        if((uName = request.getParameter("uName") != null)
          if((uPass = request.getParameter("uPass") != null)
            if(Check.Login(uName,uPass))
              response.sendRedirect("LoggedIn.jsp");
    /* code for Login
      public static boolean Login(String name, String password){
        if(name.equals("user"))
          if(password.equals("pass123"))
            return true;
        return false;
    %>
        <FORM Action="Login.jsp" Method="GET">
          <TABLE>
            <TR>
              <TD>User Name:</TD>
              <TD><INPUT Type="TEXT" Name="uName"/></TD>
            </TR>
            <TR>
              <TD>User Password:</TD>
              <TD><INPUT Type="PASSWORD" Name="uPass"/></TD>
            </TR>
            <TR>
              <TD><INPUT Type="SUBMIT" Value="GO"/></TD>
              <TD><INPUT Type="RESET" Value="Reset"/></TD>
            </TR>
          </TABLE>
        </FORM>
      </BODY>
    </HTML>LoggedIn.jsp
    <HTML>
      <BODY>
        <H1>You Have Logged In</H1>
      </BODY>
    </HTML>JAVA
    import .....;
    public class Connector {
      public static void main(String[] args){
        String path = "http://localhost:8080/MyWebApps/TestEnv/";
        Connection conn = new Connection();
        try{
          conn.loadURL(path);
        }catch(Exception ex){
          Sysyem.out.println(ex.getMessage());
      public void loadURL(String path) throws Exception{
         URL url = new URL(path);
         BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
         String HtmlInputLine;
         while((HtmlInputLine = in.readLine()) != null)
           System.out.println(HtmlInputLine);
         in.close();
    }

  • Problem with displaying BLOB images on JSP page using a servlet

    hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that servlet, that is http://localhost:8080/ImageServlet. It doesn't work when i try to use that servlet to display my image on my JSP page (my JSP page displays only a broken-image icon ) I tried several coding approaches with my servlet (used both Blob and BLOB objects), and they work just fine as long as i display images explicitly using only the servlet.
    Here's what i use : ORACLE 10g XE , Eclipse 3.1.2, Tomcat 5.5.16 , JDK 1.5
    here is one of my image servlet's working versions (the essential part of it) :
                   BLOB blob=null;
              rset=st.executeQuery("SELECT * FROM IMAGES WHERE ID=1");
              while (rset.next())
                   blob=((OracleResultSet)rset).getBLOB(2);
              response.reset();
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition","filename=42.jpeg");
                    ServletOutputStream ostr=response.getOutputStream();
                   InputStream istr=blob.getBinaryStream(1L);
                    int size=blob.getBufferSize();
              int len=-1;
                    byte[] buff = new byte[size];
                         while ((len=istr.read( buff ))!=-1 ) {
                   ostr.write(buff,0,len);
             response.flushBuffer();
             ostr.close(); and my JSP page code :
    <img src="/ImageServlet" border="0"  > If you could just tell me what i'm doing wrong here , or if you could show me your own solutions to that problem , i would be very greatful ,cos i'm realy stuck here , and i'm rather pressed for time too. Hope someone can help.

    I turns out that it wasn't that big of a problem after all. All i had to do was to take the above code and place it into another JSP page instead of into a servlet like i did before. Then i just used that page as a source for my IMG tag in my first JSP. It works perfectly well. Why this doesn't work for servlets i still don't know, but it's not a problem form me anymore . Ofcourse if someone knows the answer , go ahead and write. I would still appriceatte it.
    here's the magic tag : <img src="ImageJSP.jsp" border="0"  > enjoy : )

  • How to upload an image in jsp page

    hi,
    I want to upload an image file with my jsp page, but i cannot do it,
    I have used Jakarta common file upload for this & i have also read following file. But my code isnot working properly? Can you give me any example how to upload an image & how to display it?
    Can u give me any source code? Please help me.
    http://jakarta.apache.org/commons/fileupload/using.htmlwith regards
    Bina

    Hi,
    But after writing the following code i have got following error? What's the problem of this code? please help me?
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <%@ page import="org.apache.commons.fileupload.*" %>
    <%@ page import ="java.util.*" %>
    <%@ page import ="java.io.*" %>
    </head>
    <body>
    <%
    boolean isMultipart = FileUpload.isMultipartContent(request);
    DiskFileUpload upload = new DiskFileUpload();
    List items = upload.parseRequest(request);
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
    FileItem item = (FileItem) iter.next();
    if (item.isFormField()) {
    String name = item.getFieldName();
    String value = item.getString();
    //ring name= request.getParameter("")
    %>
    <%= name %>:<%= value %>
    <%
    } else {
    %>
    <%
    InputStream stream = item.getInputStream();
    OutputStream bos =
         new FileOutputStream(getServletContext().getRealPath("/images"+"/"+ item.getName()));
    int bytesRead = 0;
    byte[] buffer = new byte[8192];
    while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
    bos.write(buffer, 0, bytesRead);
    bos.close();
    stream.close();
    item.delete();
    %>
    </body>
    </html>Error is:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileUpload cannot be resolved
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    DiskFileUpload cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    DiskFileUpload cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileItem cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileItem cannot be resolved to a type
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileUpload cannot be resolved
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    DiskFileUpload cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    DiskFileUpload cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileItem cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileItem cannot be resolved to a type
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Please help me.
    With regards
    Bina

  • How to load only the jsp page even after applying template

    Hi,
    I have a webpage template with header,footer, Dynamic Menu etc. Now I assigned this .jtpl template to all my existing fases jsp files.
    The problem is when I submit a form in jsp, the entire page including template gets loaded again by which we can notice significant time for loading menus and other things.
    Is there any way to avoid this entire template loading and make only the jsp page to load? Please help
    May be this can be achieved by frames. But I dont have idea on how I can merge template with frames. If someone can provide that even would help me better.
    Thanks in advance.

    Hi
    I found the solution .
    <html>
    <head>
    <script language="JavaScript">
    function checkRefresh()
    if( document.refreshForm.visited.value == "" )
    alert('first ime');
      // This is a fresh page load
      document.refreshForm.visited.value = "1";
      // You may want to add code here special for
      // fresh page loads
    else
    </script>
    </head>
    <body onLoad="JavaScript:checkRefresh();">
    <form name="refreshForm">
    <input type="hidden" name="visited" value="" />
    </form>
    </body>
    </html>

  • Display loading image before pre page load

    hi,
    We have requirement some pages are loading very slow, while the page is processing we need to display a loading image. How to achieve this requirement.
    Especially in IPC on click of one portlet it is taking some time to display in other portlet.
    Thanks
    Manu

    Use Javascript

Maybe you are looking for

  • Problems with Adobe Acrobat XI Pro

    Last week I installed via Adobe Creative Cloud the new "Adobe Acrobat XI Pro" on my computer. After the installing I couldn´t open it, so I deinstalled it. I thought it is a problem of my computer. I tried to reinstall the software with the Adobe App

  • Moving music from Windows Media Player to iTunes

    Hi Apologies if this is repeating what others have asked many times in the past - I know what these forums can get like sometimes! I have had a look around though and couldn't find a definitive answer, so... I have to date put all my music in Windows

  • Mac mini server problem after restart. Desperate scream out for help

    Hi there....after restarting my mac mini server I have a white screen with an apple logo in the middle. Anybody here to find help with?

  • Apache HTTP server and Tomcat integration using mod_jk

    Hi, I'm trying to get Apache version 2 Server running with Tomcat 7 as the Java Servlet container (I'll be using Solr as the webapp next). Followed the instructions in the wiki articles Tomcat and Apache and Tomcat. The applications work fine separat

  • Mobile Portal and Design Studio

    Is it correct to assume that a Design Studio application could be presented on a mobile device using only the Mobile EP and the BW, without the need for the BO  BI 4 platform?