Generating Jsp Page On Runtime

I have a problem regarding generating jsp page on the run time.according to the prefrence the user selects i have to generate a jsp page.suppose 25 feilds are there to be displayed for User A then these 25 feild will be equally divide in two column one column will contain 13 row and one colunm will have 12 rows.these values come from the database and according to that value i have to make the rows and column in the jsp page.the value can be different for different users.can anyone please let me know how this is done.if there is an code example please let me know.
Regards
Ved

you don't need to generate the JSP, but simply generate the HTML according to the user settings (I don't know if this was clear or not, so I have made it explicit)
Obviusly how to achieve this could be quite complex, but you can try to generate html table according to user preferences (#columns, #rows or try to find out these infos from #total elements)
Sorry, I've no examples for yuo
--=> Ivan

Similar Messages

  • Is there any template framework to generate flex pages at runtime?

    Earlier I have worked on Apache Velocity project. With a single velocity template I was able to render 800+ different jsp pages at runtime.
    Is there any framework/functionality similar to Velocity or Freemarker framework, in flex?

    Create a zip and rename it to .cab. - that's what half of the cab files around are.
    (not a serious suggestion, but there are at least four different CAB file formats, zip included, some used in Microsoft official products, others in common products that run on Windows like Install Shield, and you need to find out what whatever is going to read it expects to be in the-file-that-happens-to-end-in-CAB before you can look for code to write it)
    (which reminds me of a web content filter at one company I used to work out which blocked all URLs which ended in CAB, so every now and again you'd get blocked from sites which used hex session keys in their URLs)

  • No JavaScript libraries seem to be included in generated JSP pages

    JHeadstart 10g (9.0.4)
    Struts/JSP
    It seems that the generated JSP files do no longer contain the necessary runtime JavaScript libraries.
    Pages generated with 9.0.4Beta 3 contained the statements:
    <script language="javascript" src="jheadstart/form.js"> </script>
    <script language="javascript" src="jheadstart/messages.js"> </script>
    <script language="javascript" src="jheadstart/calendar/calendar.js"> </script>
    Is this intentional? I get JavaScript errors so I have the feeling at least something is wrong.
    thanks and best regards
    Lucas

    Lucas,
    These javascript libs are now defined in routerForm.jsp which is generated as an include in your page.
    When upgrading from an older jheadstart version, make sure you delete all your jsp includes (and uix templates), so the JAG will copy the latest version to your file system.
    Steven.

  • Errors in generated JSP pages (JDev 10.1.3)

    Hello all,
    I'm having this error in generated pages and I don't know how I can solve it.
    Error(1,51): HttpJsp not found in class maretours.boekjaarjsp.html.errorpage.
    generated code: public class errorpage extends oracle.jsp.runtime.HttpJsp {
    Error(1,39): method getPageContext(maretours.boekjaarjsp.html.errorpage, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, null, boolean, int, boolean) not found in class javax.servlet.jsp.JspFactory.
    PageContext pageContext = factory.getPageContext(this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);
    Is there a problem with my libraries or what do I have to do to solve this?
    Thanks in advance!
    Johan Geerts

    any information on this topic?
    Thanks.

  • How to break up a huge XML file and generate serialized JSP pages

    I have a huge xml file, with about 100 <item> nodes.
    I want to process this xml file with pagination and generate jsp pages.
    For example:
    Display items from 0 to 9 on page 1 page1.jsp , 10 to 19 on page2.jsp, and so on...
    Is it possible to generate JSP pages like this?
    I have heard of Velocity but dont know if it will be the right technology for this kind of a job.

    Thank you for your reply, I looked at the display tag library and it looks pretty neat with a lot of features, I could definitely use it in a different situation.
    The xml file size is about 1.35 MB, and the size is unpredictable it could shrink or grow periodically depending on the number of items available.
    I was hoping to create a documentation style (static pages) of the xml feed instead of having 1 jsp with dynamic pages
    I was looking at Anakia : http://jakarta.apache.org/velocity/docs/anakia.html , may be it has features that enable me to create static pages but not very sure.
    I think for now, I will transform the xml with an xsl file and pass the page numbers as input parameters to the xsl file
    null

  • How to parse a JSP page?

    Hello,
    I currently use JBoss with Tomcat as Application Server.
    I'm developping an application and I would need to validate (through parsing) a JSP page on runtime.
    Can someone help me? Is it a possibility to use the API from Tomcat, or can I delegate this parsing process to Tomcat?
    Thank you in advance.
    bgOnline

    do u mean passing???
    try scope application

  • JSP Page - HTML fields validator

    We are designing this new project, which involves writing lots of JSP pages. Now the HTML pages will be designed by Web designer. but the actual code for JSP page will be written by developers.
    We have a repository containing field names. This repository can be in XML file/DB etc.
    Our requirement is that the web designer can develop any HTML page but the field names should only be from the given repository. So do we have any development tool(s) which can do the same? or do we have any web page validator? or can somebody suggest what will be the best way to do it, if we have to develop some code

    Hi Rahul,
    You can print your dynamically generated jsp page by using Javascript code
    Try this code in the head region
    <script language="Javascript">
    function print()
    document.print();
    </script>
    in the hyperlink <a href="Javascript:print();>print</a>
    keep me posted on your progress..
    Prakash                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Using Runtime.Exec() on a JSP page

    I need to run a command on a JSP page. The source code is:
    <%@ page contentType="text/html;charset=WINDOWS-1252"%>
    <%!class StreamGobbler extends Thread
    InputStream is;
    String type;
    StreamGobbler(InputStream is, String type)
    this.is = is;
    this.type = type;
    public void run()
    try
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    while ( (line = br.readLine()) != null)
    System.out.println(type + ">" + line);
    } catch (IOException ioe)
    ioe.printStackTrace();
    %>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=WINDOWS-1252">
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <TITLE>
    Demo
    </TITLE>
    </HEAD>
    <BODY>
    <% try
    String osName = System.getProperty("os.name" );
    String[] cmd = new String[3];
    if( osName.equals( "Windows NT" ) )
    cmd[0] = "cmd.exe" ;
    cmd[1] = "/C" ;
    cmd[2] = "d:/oracle/806/bin/plus80.exe iess/iess@iess1 @ d:/IessADM/webserver/uploads/test.sql";
    else if( osName.equals( "Windows 95" ) )
    cmd[0] = "command.com" ;
    cmd[1] = "/C" ;
    cmd[2] = "d:/oracle/806/bin/plus80.exe iess/iess@iess1 @ d:/IessADM/webserver/uploads/test.sql";
    Runtime rt = Runtime.getRuntime();
    System.out.println("Executing " + cmd[0] + " " + cmd[1]
    + " " + cmd[2]);
    Process proc = rt.exec(cmd);
    // any error message?
    StreamGobbler errorGobbler = new
    StreamGobbler(proc.getErrorStream(), "ERROR");
    // any output?
    StreamGobbler outputGobbler = new
    StreamGobbler(proc.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();
    // any error???
    int exitVal = proc.waitFor();
    out.println("ExitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();
    %>
    </BODY>
    </HTML>
    This command run a database script, it seems to run but the page doesn't appear, it hangs. Could you tell me what am I doing wrong, please? Do you have any idea?

    Take the relevant code and put it into an application program, and run that application on the same system where the JSP is running, with the same environment (path, classpath, current directory, etc). See what happens.
    By the way, on my system System.getProperty("os.name") returns "Windows 2000", so perhaps your code is not general enough.

  • How to Generate a Java file for a JSP Page

    Hi ,
    I am using weblogic11 .
    I am working on a JSP page which nearly consists of 4000 lines of code.
    I need to debug the file , but weblogic server is not generating the java file for the JSP pages .
    Please let me know how can i genertae Java file for the jsp pages ??

    JSPs are compiled into servlets automatically and those classes are stored in WEB-INF/classes folder. Servlet engine handles servlets.

  • How to generate report in pdf format through a JSP page

    I require to generate my report from my JSP page into a PDF format . How can i do it?

    Use a Java API which can create PDF files based on some collection of plain vanilla Java objects (List, String, Number, etc).
    Google can find them all. Just feed it with something like "Java PDF API" or so. A commonly used one is iText.
    That said, when talking about this in JSP context, ensure that you do NOT write raw Java code in JSP files using scriptlets. Raw Java code belongs in Java classes. In such case you need a Servlet. In JSP just use taglibs and EL to interact with backend Java code and data. Scriptlets are discouraged since over a decade.

  • CHART BUILDER ERROR WHEN TRYING TO GENERATE DYNAMIC CHARTS ON A JSP PAGE

    I'm working with J Develop 9.03 on Windows 2000 Professional Edition.
    I'm using the JSP demo files provided with Oracle Chart Builder to generate
    dynamic charts. The user specifies the query parameters, including the date
    range and the query results are returned by means of a line chart (with date on
    the x axis and values on the y axis).
    When trying to compile the project I get the following error messages:
    Error(165,2): class FileOutputStream not found in class _graph
    Error(170,5): class File not found in class _graph
    Error(176,4): exception java.io.IOException is never thrown in the
    corresponding try block
    I checked to see that the chartbuilder library (chartbuilder.jar) files are
    loaded into the project library. It's unusual that the class is not being
    found. I don't understand why. I developed my project using the following steps:
    1. Unzipped Chart Builder installation files into c:\Oraclechartbuilder
    2. Loaded chartbuilder class library
    c:\Oraclechartbuilder\chartbuilder\lib\chartbuilder.jar into J Developer class
    path (by selecting <Project Settings> <Paths> and browsing to the
    chartbuilder.jar file).
    3. Created a new JSP page in J Developer (graph.jsp)
    4. Copied JSP code syntax from the Word Pad demo file and pasted into graph.jsp
    5. Changed the DB connection parameters and static directory location on the
    JSP page.
    6. Compiled the project and received the above errors.
    I would like to know why the classes are not being found and how to fix the problem. Thanks, Jaafar

    Hi mshah101,
    This can happen if the applet is compiled using an higher version of java and the browser is pointing to an older version (even if minor version number is higher)

  • Runtime eror in IPC JSP PAGE

    Hi
    We are using CRM5.0 and AP7.00. We are getting error while displaying
    the JSP page sometimes.
    Let me give u feedback on the reason.
    We have a V-table Say TAB1 with 3 characteristic in it. This V-table is
    used in 2 different Models(2 Kmats). KMAT1 has CHAR1 and CHAR2 in the
    Class and KMAT2 has CHAR1,CHAR2 and CHAR3 in the Class.
    We are creating 2 Procedures PR0_KMAT1 for KMAT1 and PR0_KMAT2 for
    KMAT2.
    In the Procedure PR0_KMAT1 for KMAT1 we are using the Table TAB1 with
    only CHAR1 and CHAR2 while in case of Procedure PR0_KMAT2 for KMAT2 we
    are using all the 3 chacteristics CHAR1,CHAR2, and CHAR3.
    The error is coming only in the first KMAT1. Is it coming due to using
    a V-Table having a characteristic CHAR3 which is not present in the
    Class of KMAT1.
    My understanding about AP7.00 was that the error will only come if u
    are using a Characteristic in a Procedure but that Characteristic is
    not present in the Class.
    I tried this in a Model but it did not give me an error. Which was
    surprising.
    Till now we have always maintained all the cstics in the class.if they
    ae present in the V-Table.
    But as we are going forward we have V-tables which are commonly shared
    and don't have cstics present in the Class.
    So my question is do we need to have the cstic in the Class if its
    present in the V_table even though we are not using it in the Procedure
    for that Model.
    My understanding was all cstic should be in the class if they are
    present in the V_table even if we are not using them in any Model.Is
    this the reason why we are sometimes getting an error on the runtime in
    JSP.
    Incase of ECC i know we need not have the cstic Present in the Class
    and it will also not give any error.
    Can u please clarify this point.
    Amit Bhan

    Ay ay ay!! Ok I goofed up my own code. Others might find it helpful to lean from my pain today. Please follow the link at http://bugs.mysql.com/bug.php?id=13289 . There are other posts in the Java forums here on the same problem if I would pay closer attention ;-). I was using executeUpdate(sql); with my parameterized query when I should have been using executeUpdate(); Making this switch solved the problem for me. Here is the complete method that works for your purusal :-)
    private void logToolException(ToolExceptions toolException)
    Connection connection = null;
    String sql = "";
    try
    connection = ConnectionModerator.getConnection();
    Login login = toolException.getLogin();
    sql = "INSERT INTO TOOL_ERROR_LOGS (" +
    "BUSINESS_ID, " +
    "TEAM_ID, " +
    "PERSON_ID, " +
    "TOOL_NAME, " +
    "VERSION, " +
    "CLASS_NAME, " +
    "METHOD_NAME, " +
    "STACK_TRACE, " +
    "CREATION_DATE)" +
    " VALUES (" +
    "?, " +
    "?, " +
    "?, " +
    "?, " +
    "?, " +
    "?, " +
    "?, " +
    "?, " +
    "NOW())";
    PreparedStatement statement = connection.prepareStatement(sql);
    statement.setInt(1, login.getBusinessId().intValue());
    statement.setInt(2, login.getTeamId().intValue());
    statement.setInt(3, login.getPersonId().intValue());
    statement.setString(4, toolException.getToolName());
    statement.setString(5, toolException.getVersion());
    statement.setString(6, toolException.getClassName());
    statement.setString(7, toolException.getMethodSignature());
    statement.setString(8, toolException.getExceptionStr());
    statement.executeUpdate();
    catch(Exception e)
    //TODO Handle this exception better.
    this.getServletContext().log("Using query: " + sql);
    String message = "Exception!: ";
    this.getServletContext().log(message, e);
    finally
    try
    ConnectionModerator.closeConnection(connection);
    catch(Exception e1)
    //TODO Handle this exception better.
    String message = "Exception!: ";
    this.getServletContext().log(message, e1);
    -Daniel

  • Generating error page(in jsp) when session expires....

    hello,
    i want to generate error page(in jsp) when session get expires...
    plz help me out.............

    You could do it according to the line BalusC supplied in another topic:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=login.jsp">The only thing you gotta change, is the URL, make it:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp">Create 'error.jsp' and have the message 'Session expired, sorry!' or something printed. If you want to use error.jsp for more than just the session expiration, add a parameter to it:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp?error=sessionexpired"> Place the following lines in your error.jsp:
    String errormessage = request.getParameter("error");
    if(errormessage.equals("sessionexpired")){
    out.println("Your session has expired, sorry!");
    }else if(errormessage.equals("whatever")){
    // To do code here.
    }

  • How we can generate dynamic menu in jsp page

    Hi all,
    how we can generate dynamic menu in jsp page.
    Thanks
    Manjinder

    by reading more about them on the web or in a good book, OR BY HIRING SOMEBODY TO DO SO. ;)

  • 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 :)

Maybe you are looking for

  • {SOLVED] Create characteristics with BAPI_CREATE_BATCH

    Hello, In my program I create a batch before a good receipt. This good receipt is created with the bapi 'BAPI_GOODSMVT_CREATE'. In this last bapi I'm able to add the batch number. If I create the batch I have also to add some characteristics. So I ha

  • Unable to remove business partner catalog numbers

    Hello, I have created a business partner catalog number for one item. Now I want to remove that catalog number but it is not possible. I have tried to remove the catalog number over the menu item "Data" and the function "Remove". I get the positive s

  • Waiting for Sec always

    Hello,     1) I am working on DAQ and I need some help to take decision in best way. I am using JKI state machine, which having one case for DAQ and another cases for controlling the serial device. I need to swich the cases always until my Serial dev

  • Can i use one datafile from different database to my database ?

    hi, i copied one datafile from development server to my database ? how can i use this datafile can i re-create controlfile , please suggest? Edited by: 819136 on Jan 12, 2011 2:45 AM

  • Running out of USB space

    I'm running out of USB spots on the back of my new MacPro, (Back-up Drive, iPad, iPhone, Keyboard, printer etc...).  Is there a Thunderbolt to USPB adapter?