Dynamic generate JNLP from JSP ?

Hello,
I tried to generate JNLP from JSP, but it just show the Opem/Save diakog and cannot startup the Web Start.
I am using Tomcat-5.5.12 in WinXP + JDK1.5
How can I dynamically generate JNLP ?
Eric

It will range from easy to rather difficult, depending on how hard you try...
If you want to do the bare minimum it will require you to code up some JSPs with scriptlets, declarations, expressions, and <jsp:xxx ...> tags, have some server turn them into a servlet for you, and then determine how things like
<%@ page isELIgnored="false" %> are handled. Things like:
<jsp:useBean ...> <jsp:setProperty ... > should be rather easy to translate using introspection on the beans they refer to. But <jsp:import ...> and the likes may be more difficult.
Any normal html code is just wrapped inside a out.println(...) statement. Scriptlets should have the <% %> stripped and coppied to the output. Expressions should have their <%= %> stripped and be added to the surrounding out.println...
for example:
<a href="<%=thePage%>">
should become:
out.println("<a href=\""+thePage+"\">");
All the content should be added to a _jspservice method.  Then, things between <%! %> should be coppied to source file as methods.
Complications come when people start to use custom tags. You will have to learn how to create a PageContext that will be available to the jsp service method.
You should also look up the JSP/Servlet spec to see how this stuff should be done.
It is a whole nuther can o worms if the resulting JSP is expected to compile without a server...</a>

Similar Messages

  • Generating charts from jsp

    Hi there,
    i am a jsp novice and i am looking to generate chart using data in a dbase. can anyone point me in the right direction how to use JChart(in jsp) to generate chart from a database? I am looking to generate Barcharts and Line charts.
    it is my first attempt and i do not know where to start from. Any help would be greatly appreciated.
    thanks
    ravikiran
    mail : [email protected]

    hai man,
    will generating of the graphs take time... what will be the execution tie of a graph... for example if i want to generate the work performance of a team from the performance sheet i have and wanted it to be dynamically displayed( how much time it will take) since when I am doing the same in excel it is taking around 5 minutes to display the graph.will it take the same time when i use the technologies that were mentioned here ...
    i need ur help is it possible to generate the graphs online with dynamic data.
    SUGGEST ME ABOUT PROCEEDING FURTHER..
    THANKS
    RAVI

  • Dynamically generate javascript in jsp

    i really need sm ideas...
    i have got image url in my table in database.. for eg:---------> /img/img.jpg(this is there in my table)
    in the jsp page i have got the urls in an arraylist..now i have to put it on roll...for eg there are10 images, when the page loads i have to display the first image and then on mouseover it will keep rolling to the next image and it goes on..
    the roll is done in javascript..
    i have to dynamically generate the javascript...what do i do?...how do i do that?

    which JavaScript you want to generate?
    Can you post your jsp and explain what kind of javascript you want to generate in that jsp?

  • Generating PDF from JSP

    how would i generate a PDF from JSP.....
    urgent........
    thanks in advance.....
    HELP.........
    senthil

    Use response.setContentType("application/pdf") .

  • Including dynamically generated pages in jsp

              Hello All, Scenario is like this, i am creating the dynamic htmls pages, in the
              servlets and after creating the htmls pages in the servlets , the control passes
              to the jsp page, where i am including the html page that is created at the servlets,
              its works fine, but some time it shows me null exception at the jsp page, i.e
              it won't find the htmls pages, even they are created b'fore. I am using weblogic
              server 6.1 with sp3. Can anybody know what is the reason.
              

    After you have generated checkbox by jsp, you have to generate JavaScript for the checkboxes.
    <%
    // assume I have found I need to generate 5 checkboxes with jsp
    int chkboxCount = 5;
    String user = request.getParameter("user");
    boolean showUser = false;
    if (user!=null && user.trim().length()>0){
      showUser = true;
    %>
    <script lang="JavaScript">
    var chkcount = <%=chkboxCount%>;
    for (int i=0; i<chkcount; i++)
         alert(i);
    <%
    if (showUser)
    %>
        alert("hello <%=user%>");
    <%
    %>
    </script>It is difficult to trace though.
    Edited by: evilknighthk on Nov 25, 2007 11:55 PM

  • WL10 generated servlets from jsp pages

    hi!
    I'm looking for .java servlet files automatically generated from JSP (Weblogic 10). Do anybony know where can I find this files?
    Thanks in advace,
    Bartek

    Well, Servlet and JSP both are server side technologies and both can be used in web applications. You can write web pages using both servlet and JSP. In fact, your JSP pages are converted to Servlet by container while serving requests. However, writing a JSP page is relatively easier and requires minimal Java knowledge.
    When you will develop real world java based web applications you will find that you are writing more JSP pages than servlet.
    In a typical MVC (Model View Controller) architecture a single servlet is used as controller and JSP pages are used to generate web content.
    Thanks,
    Mrityunjoy

  • What is the best way to delete dynamically-generated symbols from another symbol?

    in the onClick handler for 1 symbol, I have:
    var sandwhichQty1 = sym.createChildSymbol("sandQty1", "Stage");
    another symbol inside sandQty1 has the onClick method:
    this.deleteSymbol();
    which works fine, deleting sandQty1. I'd like to delete it, and others, from another button, in the circumstance where users don't close them this way.
    I notice that id and class are dynamically assigned to the child symbol, which makes it hard for me.
    any ideas?

    Hi, I did it in this way, and functions well; maybe this is not the best way, but worked for me. Obviously this code is based on the elainafineell's correct solution.
    This is my scenario:
    In a Trigger @ xxxxms there is that:
    var i = 1;
    $.each(results, function(index, element)
         var s = sym.createChildSymbol("mySymbol", "someContainer");
         // some code here
         // Creating the variable that save my new instance of mySymbol
         sym.setVariable("var_id"+i, s);
         i++;
    // a global var, take care with the name
    numOfInstances = i;
    Then, in a click action of some button, symbol, anything that support an action, I code this:
    sym.eraseSymInstance();
    And, in the creationComplete, I code the function like this:
    sym.eraseSymInstance = function()
              for(var i = 1; i <= numOfInstances; i++)
                             var s = sym.getVariable("var_id"+i);
                             s.deleteSymbol();
    For me function well.
    I hope this can be usefull for somebody else.

  • Is anyone know how to create dynamic pdf file from a JSP page or Servlet ?

    Hi
    Is any one know how to create a dynamic PDF file from JSP or servlet. I need to have standard form format needs to be created and want to send the info to that form dynamically.
    Is there any libraries available?
    Thanks

    I posted a link in this thread to a lib that lets you create PDFs from an app. They have a Java version. I have not used it but I know someone who used it with Microsoft ASP and they liked it.
    http://forum.java.sun.com/thread.jsp?forum=31&thread=287285
    -S-

  • HTML from JSP

    Hi all,
    I got a problom,
    How can i get the output of a JSP page into a java class?.That is,The original JSP page sends the generated HTML to the browser.What i need is that generated HTML into a java class.
    Suppose i got an Email class ,
    String myContent = -------
    Email.setContent(mycontent);
    The string myContent should be the dynamically generated HTML from a JSP page.
    that is,
    String myContent = output from CustInfo.jsp.
    How to achieve this?.

    >
    String myContent = output from CustInfo.jsp.
    How to achieve this?.Open a URLConnection (or HttpURLConnection) to CustInfo.jsp,
    use the getInputStream() method to get a reference to the input stream for the jsp,
    read this stream (which will be the HTML for CustInfo.jsp) into the String.

  • Forwarding to an xml file from jsp page

    hi
    i am subhash. i have problem in forwarding an xml file from jsp page.
    i have a jsp page in which i have a button. upon click, its form method is triggered and the action is set to "serverpage.jsp". In that jsp page i have to move to an xml file. I would like u to send a sample code also for the same.
    Thank You,
    Subhash..

    Refer to the Generating XML from JSP section.
    http://java.sun.com/developer/technicalArticles/xml/WebAppDev2/

  • Dynamically generating the jnlp file

    Hi Experts,
    Im working on a project in which we launch the Eclipse RCP from the web UI (thin client).
    I want to dynamically generate the jnlp file cause I want to pass the session of the user from the web client to RCP.
    So for this i have thought of having a variable let say sessionID ,which will take value of the session
    sum thing like this...
    <application-desc main-class="com.rcp.core.HelloWorld">
    <property name="sessionID" value="$$userSessionId"/>
    </application-desc>
    But im not able to figure out how i will populate the sessionID variable.
    which class should be responsible for doing this?
    whether that class will be in the RCP code or in the Web code...i guess it is in the web code?
    Please if u can clarify these doubts then it will be great.
    Thanks
    ved

    usually you would use jsp or a servlet to generate the jnlp file.
    If you extend the JnlpDownloadServlet (found in the sample directory in the JDK) you can generate the session id.
    /Andy

  • How to generate Word document from JSP ?

    Hi,
    I want to generate Word documnet from JSP. I am using Neva objects to generate Word document. Now my problem is Word doc generation code works alright as a Java application but when I place that piece of code in a JSP bean it throws an exception. The reason seems to be unavailibility of DLLs and other files of Neva in Tomcat environment. I do not want to use other complex packages like JIntegra, I would prefer any freeware solution. There is not much info. about Word document generation on POI project in Jakarta site.
    Could anyone suggest way out ? Any Java examples doing the same would be of great help.
    Thanks,
    Akash

    Hi Saurabh,
    Thanks for the reply.
    I have tried that too. Problem with that solution is that if you have used CSS in your JSP code MS word does not understand it and generates word doc which is not the same as HTML which JSP otherwise would have generated.
    Akash

  • Dynamically generate JSF Source code in a JSP

    Hi,
    I have a JSP and instead of writing the JSF source Code like:
    <h:inputText
    styleClass="entryInput"
    id="textNumberOfServerMachinesInput"
    value="#{DataAccess.value}"
    valueChangeListener="#{InputValueChanged.processValueChange}">
    </h:inputText>
    manually in the jsp I want the JSF source code to be added dynamically to the jsp.
    So what I want is including a tag in the jsp and this tag generates JSF source code like seen above.
    This source code should then be treated just the way it would be if I had written it manually in the JSP. This means that the dynamically generated JSF code must be interpreted and all Listeners and Beans work just fine.
    How can I make this???

    Hi,
    I have a smiliar problem:
    JSP:
    <h:panelGrid binding="#{fileUploadGrid.panelGrid}">
       <%-- emty in jsp --%>
    </h:panelGrid>The panel should be populated with items the backing bean creates in source code:
    FileUploadGrid.java
    public void setUploadFieldNumber(int uploadFieldNumber) {
        this.uploadFieldNumber = uploadFieldNumber;
        this.refresh();
    private void refresh() {
        if (this.panelGrid == null)
          this.createPanelGrid();
        List children = this.panelGrid.getChildren();
        children.clear();
        for (int i = 0; i < this.uploadFieldNumber; i++) {
          HtmlOutputText out = new HtmlOutputText();
          out.setTitle("Image " + i);
          out.setRendered(true);
          HtmlInputText in = new HtmlInputText();
          children.add(out);
          children.add(in);   
    private void createPanelGrid() {
        this.panelGrid = new HtmlPanelGrid();
        this.panelGrid.setColumns(2);
        this.panelGrid.setCellpadding("1");
        this.panelGrid.setBorder(1);
        this.panelGrid.setWidth("50%");
        this.panelGrid.setRendered(this.isRendered());
    public void setPanelGrid(HtmlPanelGrid panelGrid) {
        this.panelGrid = panelGrid;
      public HtmlPanelGrid getPanelGrid() {
        return this.panelGrid;
    }The backing bean is initialized in faces-config.xml:
    <managed-bean>
      <managed-bean-name>fileUploadGrid</managed-bean-name>
      <managed-bean-class>org.smi.pte.isf.FileUploadGrid</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      <managed-property>
        <property-name>rendered</property-name>
        <value>true</value>
      </managed-property>
      <managed-property>
         <property-name>uploadFieldNumber</property-name>
         <value>6</value>
      </managed-property>
    </managed-bean>The problem is: although the debug output of the faces framework (I use it along with Tomcat) shows that the in- and output fields are added correctly to the panel, the page remains empty at display.
    Thanks in advance for any help.
    F. Eckhardt

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

  • Filename on file download from jsp

     

    This may help:
              ----- Original Message -----
              From: "Erik Lindquist" <[email protected]>
              Newsgroups: weblogic.developer.interest.jsp
              Sent: Wednesday, June 28, 2000 6:20 PM
              Subject: How to dynamically display images in JSPs
              > This took a little while to figure out so I thought I'd share. After
              > doing some research I was led to the following approach on how to load
              > images from an Oracle database into a JSP:
              >
              > The "main" JSP:
              >
              > <HTML>
              > <head>
              > <title>Image Test</title>
              > </head>
              > <body>
              > <center>
              > hello
              > <P>
              > <img border=0 src="getImage.jsp?filename=2cents.GIF">
              > <P>
              > <img border=0 src="getImage.jsp?filename=dollar.gif">
              > <P>
              > world
              > </body>
              > </HTML>
              >
              >
              > And this is the image getter:
              >
              > <% try {
              > response.setContentType("image/gif");
              > String filename = (String) request.getParameter("filename");
              > java.sql.Connection conn =
              > java.sql.DriverManager.getConnection("jdbc:weblogic:pool:orapool"); //
              > connect to db
              > java.sql.Statement stmt = conn.createStatement();
              > String sql = "select image from testimage where filename = '" +
              > filename + "'";
              > java.sql.ResultSet rs = stmt.executeQuery(sql);
              > if (rs.next()) {
              > byte [] image = rs.getBytes(1);
              > java.io.OutputStream os = response.getOutputStream();
              > os.write(image);
              > os.flush();
              > os.close();
              > }
              > conn.close();
              > }
              > catch (Exception x) { System.out.println(x); }
              > %>
              >
              >
              > The thing to note is that there are no <%@ page import="..." %> or <%@
              > page contentType="..." %> tags - just the single scriptlet. It
              > seems that for every "<%@" the weblogic compiler sees it puts
              > out.print("\r\n"); statements in the generated java source.(???) I
              > don't know much about how browsers work but I think that once it sees
              > flat ascii come at it it treats everything that follows as text/plain
              > which is incorrect for the binary stream that's being sent. Another
              > work around was to set out = null; but that's kind of ugly and might
              > produce server errors. The real fix is to write a bean to handle images
              > which I'll work on next (does anybody have any hints on how to do
              > that?)
              Cameron Purdy
              [email protected]
              http://www.tangosol.com
              WebLogic Consulting Available
              "Ramesh" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              >
              > Even I could download the files with this technique, I couldn't open the
              file downloaded. It seems the file is getting currepted during tranfer.. Can
              u help me in this regard please?
              >
              > Thank u
              > Ramesh
              >
              > [email protected] (Anders B. Jensen) wrote:
              > >In an Web-application written in Java Server Pages it should be possible
              > >for the user to download data from the web-server. The data will never
              > >exist as a file on the web-server, only in the PrintWriter object, out.
              > >To force the Internet Explorer (IE) to show the download dialog window
              > >the Contenttype of the HTTP-header have been set to "html/transfer". The
              > >question is:
              > >
              > >Is it possible to set the filename appearing in the download dialog
              > >appearing on the client?
              > >
              > >
              > >Below is a listing of the source-code:
              > >
              > ><%@ page extends="com.beasys.portal.admin.PortalJspBase"%>
              > ><jsp:useBean id="download" scope="session" class="dk.lec.DownloadData" />
              > >
              > ><%
              > > String tmpstr;
              > > response.setContentType("html/transfer");
              > > out.clear();
              > > tmpstr=download.getStrbuffer().toString();
              > > out.println(tmpstr.trim());
              > >%>
              > >
              > >
              > >Anders B. Jensen
              > >Consultant, Research & Development
              > >LEC AS
              > >
              > >Remove the SPAMLESS to mail me.
              >
              

Maybe you are looking for

  • EJB 3.0 JPA Entities and preserving user identities

    Hello all, I've been reading about some of the techniques available to Oracle DB developers to ensure that some sense of a user's real identity is maintained in multitier applications (<http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b142

  • Airport base station agent process without the device

    Hello, just noticed that in the startup items of my macbook account I have an item labeled "airport base station agent". However, I dont have an airport base station... Since I'm having regular troubles with my wireless, I'm just wondering if anyone

  • HT1353 I need a charger for this iPod

    I am trying to find a charger for my iPod classic 20g and I am having a hard time finding one. Can any one help me?

  • Sum a UNION query

    URGENT PLS!! hi, pls im trying to query my database but i dont know how to write the query. here is what i was told to do. there are 3 tables, 1. HCP table that hold all the name of hospitals (primary key is HCP_ID) 2. EMPLOYEE table, which hold the

  • Error Event ID 11 The KDC encountered duplicate names while processing a Kerberos authentication request.

    I've been noticing The Error with event ID 11 popping up a lot on our domain controllers: The KDC encountered duplicate names while processing a Kerberos authentication request. When running setspn -X it says that it found 111 groups of duplicate SPN