Generating the JSP from the Servlet source file

Hi,
Does anyone out there know if there is any utility/class/program which will generate a JSP from the Servlet Source file (.java file) or indeed from the compiled Servlet file (.class file)
If its possible to decompile a .class file into a .java file, surely it must be possible to convert the .java souce file into the .jsp file that created it.
any comments would be appreciated
Richard

I am the author of the original JSP!
But I want to run a script on the generated Servlet source file,
changing its contents, and then generate the JSP that would have created the new Servlet source file.
but I need to know if theres anything that will reverse engineer a Servlet source into the generating JSP.
its a kind of of Jeopardy type thing!

Similar Messages

  • ERROR BPMA File Generator Failed to generate the EPMA import file

    Hi,
    I am facing the below error while extracting the metadata from the Planning Application using EPMA File Generator.
    ERROR BPMAFileGenerator Failed to generate the EPMA import file...
    Details:The remote server returned an error: (404) Not Found
    I am getting 0 byte file.Pls suggest.
    Is there any other way to extract the Planning application metadata?
    The log is:
    [Header]\r\n2010-08-23 14:24:54,484 [5900] DEBUG BPMAFileGenerator Initializing Component
    2010-08-23 14:24:55,687 [5900] DEBUG BPMAFileGenerator HyperionHome: D:\Hyperion
    2010-08-23 14:24:55,687 [5900] DEBUG BPMAFileGenerator HelpFile: D:\Hyperion\common\docs\en\epma\file_generator\launch.html
    2010-08-23 14:27:42,309 [5900] INFO BPMAFileGenerator SelectedTabIndex: 3
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmWebServer.Text: http://localhost/HFM
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hpWorkspaceURL.Text: http://lgwapp081.uk.baa.com/workspace/index.jsp
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hpWebServer.Text: http://lgwapp081.uk.baa.com:8300/HyperionPlanning/
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hpUserName.Text: admin
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hpApplicationName.Text: PLNAPP
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hpClusterName.Text: lgwapp081.uk.baa.com
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hpBPMAImportFileName.Text: C:\Documents and Settings\lgwappharrisonb-gal\My Documents\EPMAImport.ads
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator ShfmWebServer.Text: http://localhost/HFM
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmBPMAImportFileName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator bpmaApplicationName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator bpmaUserName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator bpmaWebServer.Text : http://localhost/hyperion-bpma-server
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator bpmaImportFileName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator profileFileName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator securityFileName.Text :
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator metadataFileName.Text:
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator hfmFilesImportFileName.Text :
    2010-08-23 14:27:42,324 [5900] INFO BPMAFileGenerator dimensionPrefix.Text:
    2010-08-23 14:27:42,793 [5900] ERROR BPMAFileGenerator Failed to generate the EPMA import file...
    Details:The remote server returned an error: (404) Not Found.
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator SelectedTabIndex: 3
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmWebServer.Text: http://localhost/HFM
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hpWorkspaceURL.Text: http://lgwapp081.uk.baa.com/workspace/index.jsp
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hpWebServer.Text: http://lgwapp081.uk.baa.com:8300/HyperionPlanning/
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hpUserName.Text: admin
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hpApplicationName.Text: PLNAPP
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hpClusterName.Text: lgwapp083.uk.baa.com
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hpBPMAImportFileName.Text: C:\Documents and Settings\lgwappharrisonb-gal\My Documents\EPMAImport.ads
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator ShfmWebServer.Text: http://localhost/HFM
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmBPMAImportFileName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator bpmaApplicationName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator bpmaUserName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator bpmaWebServer.Text : http://localhost/hyperion-bpma-server
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator bpmaImportFileName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator profileFileName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator securityFileName.Text :
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator metadataFileName.Text:
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator hfmFilesImportFileName.Text :
    2010-08-23 14:28:54,198 [5900] INFO BPMAFileGenerator dimensionPrefix.Text:
    2010-08-23 14:28:56,651 [5900] ERROR BPMAFileGenerator Failed to generate the EPMA import file...
    Details:The remote server returned an error: (404) Not Found.
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator SelectedTabIndex: 3
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmWebServer.Text: http://localhost/HFM
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hpWorkspaceURL.Text: http://lgwapp081.uk.baa.com/workspace/index.jsp
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hpWebServer.Text: http://lgwapp081.uk.baa.com:8300/HyperionPlanning/
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hpUserName.Text: admin
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hpApplicationName.Text: PLNAPP
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hpClusterName.Text: lgwapp083.uk.baa.com
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hpBPMAImportFileName.Text: C:\Documents and Settings\lgwappharrisonb-gal\My Documents\EPMAImport.ads
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator ShfmWebServer.Text: http://localhost/HFM
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator hfmBPMAImportFileName.Text:
    2010-08-23 14:30:10,150 [5900] INFO BPMAFileGenerator bpmaApplicationName.Text:
    2010-08-23 14:30:10,165 [5900] INFO BPMAFileGenerator bpmaUserName.Text:
    2010-08-23 14:30:10,165 [5900] INFO BPMAFileGenerator bpmaWebServer.Text : http://localhost/hyperion-bpma-server
    2010-08-23 14:30:10,165 [5900] INFO BPMAFileGenerator bpmaImportFileName.Text:
    2010-08-23 14:30:10,165 [5900] INFO BPMAFileGenerator profileFileName.Text:
    2010-08-23 14:30:10,165 [5900] INFO BPMAFileGenerator securityFileName.Text :
    2010-08-23 14:30:10,165 [5900] INFO BPMAFileGenerator metadataFileName.Text:
    2010-08-23 14:30:10,165 [5900] INFO BPMAFileGenerator hfmFilesImportFileName.Text :
    2010-08-23 14:30:10,165 [5900] INFO BPMAFileGenerator dimensionPrefix.Text:
    2010-08-23 14:30:11,275 [5900] ERROR BPMAFileGenerator Failed to generate the EPMA import file...
    Details:The remote server returned an error: (404) Not Found.
    [Footer]\r\n[Header]\r\n2010-08-24 14:50:12,606 [10620] DEBUG BPMAFileGenerator Initializing Component
    2010-08-24 14:50:13,528 [10620] DEBUG BPMAFileGenerator HyperionHome: D:\Hyperion
    2010-08-24 14:50:13,528 [10620] DEBUG BPMAFileGenerator HelpFile: D:\Hyperion\common\docs\en\epma\file_generator\launch.html
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator SelectedTabIndex: 3
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmWebServer.Text: http://localhost/HFM
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hpWorkspaceURL.Text: http://lgwapp081.uk.baa.com/workspace/index.jsp
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hpWebServer.Text: http://lgwapp081.uk.baa.com:8300/HyperionPlanning/
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hpUserName.Text: admin
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hpApplicationName.Text: PLNAPP
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hpClusterName.Text: lgwapp081.uk.baa.com
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hpBPMAImportFileName.Text: C:\Documents and Settings\lgwappharrisonb-gal\My Documents\EPMA\EPMAImport.ads
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator ShfmWebServer.Text: http://localhost/HFM
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator hfmBPMAImportFileName.Text:
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator bpmaApplicationName.Text:
    2010-08-24 14:53:26,415 [10620] INFO BPMAFileGenerator bpmaUserName.Text:
    2010-08-24 14:53:26,431 [10620] INFO BPMAFileGenerator bpmaWebServer.Text : http://localhost/hyperion-bpma-server
    2010-08-24 14:53:26,431 [10620] INFO BPMAFileGenerator bpmaImportFileName.Text:
    2010-08-24 14:53:26,431 [10620] INFO BPMAFileGenerator profileFileName.Text:
    2010-08-24 14:53:26,431 [10620] INFO BPMAFileGenerator securityFileName.Text :
    2010-08-24 14:53:26,431 [10620] INFO BPMAFileGenerator metadataFileName.Text:
    2010-08-24 14:53:26,431 [10620] INFO BPMAFileGenerator hfmFilesImportFileName.Text :
    2010-08-24 14:53:26,431 [10620] INFO BPMAFileGenerator dimensionPrefix.Text:
    2010-08-24 14:53:26,884 [10620] ERROR BPMAFileGenerator Failed to generate the EPMA import file...
    Details:The remote server returned an error: (404) Not Found.
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator SelectedTabIndex: 3
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmWebServer.Text: http://localhost/HFM
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hpWorkspaceURL.Text: http://lgwapp081.uk.baa.com/workspace/index.jsp
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hpWebServer.Text: http://lgwapp081.uk.baa.com:8300/HyperionPlanning/
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hpUserName.Text: admin
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hpApplicationName.Text: PLNAPP
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hpClusterName.Text: lgwapp083.uk.baa.com
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hpBPMAImportFileName.Text: C:\Documents and Settings\lgwappharrisonb-gal\My Documents\EPMA\EPMAImport.ads
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmWorkspaceURL.Text: http://localhost:19000/workspace
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator ShfmWebServer.Text: http://localhost/HFM
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmUserName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmApplicationName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmClusterName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmBPMAImportFileName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator bpmaApplicationName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator bpmaUserName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator bpmaWebServer.Text : http://localhost/hyperion-bpma-server
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator bpmaImportFileName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator profileFileName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator securityFileName.Text :
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator metadataFileName.Text:
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator hfmFilesImportFileName.Text :
    2010-08-24 14:56:46,427 [10620] INFO BPMAFileGenerator dimensionPrefix.Text:
    2010-08-24 14:56:47,520 [10620] ERROR BPMAFileGenerator Failed to generate the EPMA import file...
    Details:The remote server returned an error: (404) Not Found.
    Thanks,
    BC

    Yes I tried to run it on server but still getting the same error.The Status message is:
    1 Validating EPMA import file     Successful...
    2 Generating EPMA file     Failed to generate the EPMA import file...
    Details:The remote server returned an error: (404) Not Found.

  • Does a member class have to be within the same source file?

    Hi there,
    I have this application that extensively uses two classes. The main class setsup the GUI, and the second main class is responsible for handling all of the actions that arise from the GUI.
    I could have done this by making all of my handler methods be of the first main class, but this class really is just for the GUI setup, the logic doesn't fit into this class' behaviour.
    The class that handles the GUI actions is required to use the fields of the main class e.g. to get values of a text field. The problem is that since the class that handles the actions is getting very big, I would kind of like to move this class into a different source file - because currently it is a member class of the first one, so that it can access all of its fields.
    Is there some way that I can move this handler class into another source file, and still have it access all of the fields of the main GUI class - without making the fields public, or using millions of get/set methods? Also, I can't use inheritance because the both the GUI class creates an instance of the handler class in its constructor, and so leads to an infinite loop when trying to instantiate the GUI class.
    Can I ask.. would a static class or something be of use here? Do they exist? I'm confused as to how to do this without getting the mother of all source files (in size that is - nothing to do with cooking or baking).
    - Anyway, thanks in advance for any help that you could give me -
    BYEE, Edd.

    You can't have an inner class that is not in the same source file. However, you could use package-protected (default) access to give another class in the same package access to things without making them public. Actually, that's how inner classes are actually compiled. Package-protected access is underused IMHO. It's a great tool that most people (including myself) are suspicious of at first.

  • Multiple classes in the same source file

    I'm not sure what this is called, having multiple classes in the same source file. At first I thought it ws called subclassing but then I googled it and found that subclasses are just derived classes. Here's an example of what I'm talking about.
    public class A {
    class B {
    class C {
    }So first of all, what is having multiple classes in the same source file called?
    Secondly, what are the advantages/disadvantages of this?
    Thirdly, can you have a class completely WITHIN a class (same source file but inside the class not outside) and what are the advantages/disadvantages of this?

    Advantage: You can reduce the number of source files specialy when your secondry classes are used only in the public class of the file.
    Disadvantage: Normaly it make things more clear if we have one-to-one correspondance of class and source files. This make things easy when you want to find the java file of a perticuler class file. Also If you later wanted to create a seperate public class with a same name as one of those secondry classes you got lots of changes to do.
    You can avoid this by creating them as nested classes
    ex:-
    public class MyPublicClass{
       private static class MyInnerClass{
    }this way the inner class will create a class file with name "MyPublicClass$MyInnerClass.class" instead of just "MyInnerClass.class"
    And also if you declare the inner class as public you can access them from out side

  • How to generate the Cobol Source part of the ApplicationViewer

    Hello,
    I'm actually generate the Cobol Source part of the application viewer on a windows environment.
    I'm trying to build it from a Unix environment but I don't know how because I doesn't find the same script in Unix I use in windows.
    Can someone tell me how to generate the Cobol Source part of the application Viewer please ?
    Thank you in advance.

    >
    How can I read the html source code of a webpage
    with a java application?
    Is there a good idea?
    I don't know if this is a good idea, but it works.
    1) Use a URL to obtain the document's location
    2) Use a URLConnection to open a connection between your computer and the
    document server
    3) Connect to the server
    4) Get the InputStream of said connection
    5) Associate the Input Stream with a Buffered Input Stream
    At this point you can use a loop to read lines from the BufferedInput Stream and append them to a TextArea or other suitable text component.

  • The XML Source file is unavailable for viewing

    Same java application is deployed on two different servers. One server is in the intranet zone and the second one is in the internet zone. The request sent to the server is an xml file and the response from the server is also an xml.
    In intranet server, when we are trying to view the source of the response xml file , we are getting a prompt displaying the message "The XML Source file is unavailable for viewing".
    But in internet server, when we are try the same, we are getting a valid xml resposne. We are using IE 6.0 - SP1 browser.
    We tried the same in the mozilla browser and found the same results. Any suggestions on this?

    One possibility is the IE security settings under tools/internet options. The intranet site may have a lower security setting than the internet site. The browser may not ne letting the internet site download the xml.

  • On Firefox, i wish to edit details in the 'Page Source' file (CSS) and save the changes. Please help...

    I am viewing a crossword(HTML file) prepared by me, on FIREFOX. I wish to change the color of the blank squares (which are black now), to improve the appearance of CW. I have located the appropriate place on the "Page Source" file for effecting the change. ''But, I am not able to effect the change, as the file does not accept the editing.'' Please, advise
    how I can effect the change and also save the changes effected...Thanks

    It is View > Page Source and not Edit > Source, so you can't make changes to the source in Firefox.<br />
    You will have to do that via an external editor.<br />
    You can also override CS style rules with the Stylish extension.
    * https://addons.mozilla.org/firefox/addon/2108 - Stylish

  • Accessing String assigned in a JSP from a Servlet?

    Hello all, I was wondering if there is a way to access a String object that was assigned by an HttpSession object in a JSP from a Servlet. What happens is, in my application a user logs in, an HttpSession object is instantiated and all of the user credentials are assigned within a JSP like:
    HttpSession httpSession = request.getSession( false );
    String userName = httpSession.getAttribute("userName);
    ...{code}
    Next, I have a Servlet (which is really just a Proxy to a different server), that I need to log some information with, namely the userName String. Is there a way I can access that String without instantiating another HttpSession object? Because when the timeout occurs (or when the user clears his cache I have found), the HttpSession becomes invalidated (even if I use  +HttpSession#getSession( true )+) and the +HttpSession#getAttribute+ call fails (userName is just null). So is this possible to do?
    Thanks in advance!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    dnbphysicist wrote:
    I understand you cannot recover attributes from a dead session, this is why I wanted to be able to access a variable that is pulled from the Session immediately after login so I can still get to it even once the session is dead.
    Normally a session doesn't go dead after login.
    I imagine that by using application scope the app would confuse the userName with other users that are logged in?Certainly. It was just an example. But your data clearly belongs in the session, so just keep it in the session. If the session get invalidated while it should not get invalidated, then your problem truly lies somewhere else.
    I am definitely not arguing you latter point either :) A lot of this code I inherited unfortunately from previous developers and we are in desperate need of a redesign.I wish you much luck with that.

  • Executing a jsp from a servlet

    Hello all
    I am a starter to JSP.
    In an application I am developing, I have a servlet which receives a request from a form. If the user asks for a tabular representation of data (from the database), I want to use a JSP to display such a table since that way, I do not have to write all those out.printlns used in a servlet.
    So is there a way to either pass control to a jsp from a servlet? I want to pass a hashtable and some data to the jsp from the servlet.
    Please help with possible suggestions and code.
    thanks a lot....
    Mahesh :)

    There is the RequestDispatcher object to forward request to another resource (as servlet or jsp).
    If in your servlet you code:
    RequestDispatcher rd=getServletContext().getRequestDispatcher("your JSP URL");//instantiate a RequestDispatcher object
    //sets Hastable as request attribute
    request.setAttribute("yourAttributeName",yourHashtableName);
    rd.forward(request,response);//forwards control to jsp
    In your JSP you will retrieve Hashtable by following code:
    Hastable ht=(Hashtable)request.getAttribute("yourAttributeName");

  • PDF file transfer writing target file with the same source file name

    Hi to all,
    I want to transfer a PDF file from a SOURCE folder to a TARGET folder. My problem is that I want the target pdf file has the same name of the source pdf file. How can I do this? I have to look for some parameters in the sender or receiver channels?
    Thanks to all.

    Hi Gabriele,
    If you want to FTP the pdf file from source to target directory, use this blog.  It doesn't require any IR devlopment.
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    Also, In sender and receiver comm channels select "Set/Use Adapter specific message attributes" and "File Name" to get the same file name in the target directory.
    Regards,
    Sreenivas

  • Software Update Packages - the Package Source files are gone

    I am running SCCM 2012 SP1. Something or someone deleted all my deployment package source files and folders for my software updates. Once I noticed they were gone, I was expecting there to be a simple way to have SCCM reload them from WSUS, since they should
    still be there. However, I see no obvious way to do this in the GUI or from PowerShell. Is there a repair command for deployment packages that have lost their files?

    Indeed, I just tested it in my environment and the real download won't start as long as it thinks that the updates are already downloaded.
    The easiest way download them again is (if they are not all member of the same Software Update Group) temporarily add them to a SUP, delete them all from the deployment package and start the download again for all the updates in the (temporary) SUP.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Error in compiling the ejb source files......

    hi all,
    it makes me to go mad...
    i have got error sometimes while compiling the ejb java source files and sometimes not...
    i would appreciate anybody for helping me in this problem
    i am using sun application server 8.1 and javac compiler
    i have got the following error
    D:\>path=%path%;c:\j2sdk1.4.2_12\bin;
    D:\>set classpath=%classpath%;d:\Sun\AppServer\lib\j2ee.jar;
    D:\>javac d:\Librarys\Library.java
    D:\>javac d:\Librarys\LibraryBean.java
    D:\>javac d:\Librarys\LibraryHome.java
    d:\Librarys\LibraryHome.java:8: cannot resolve symbol
    symbol : class Library
    location: interface Librarys.LibraryHome
    public Library create(String id, String name, String address, String phoneNo
    ) throws RemoteException, CreateException;
    ^
    d:\Librarys\LibraryHome.java:9: cannot resolve symbol
    symbol : class Library
    location: interface Librarys.LibraryHome
    public Library findByPrimaryKey(String id) throws FinderException, RemoteExc
    eption;
    ^
    2 errors
    D:\>

    hi,
    thanks for ur reply
    i haven't tried the thing given by you
    i will reply u soon after trying out that
    but when i compiled *.java instead of compiling individual files
    everything go fine....

  • Sun Studio 12 IDE doesn't allow me to edit the C++ source files...

    I installed Sun Studio 12 on my PC:
    SunOS version 5.10 running on x86
    Java 1.5.0_16
    I created a shared library project but I can't properly edit the source files. I can't scroll up/down or right/left over the source files. I would appreciate very much if somebody could support me with that.
    Thanks and regards,
    Ioan

    Hi Gordon,
    First of all thanks for your prompt answer. Now let's go back to my problem :-) - I tried removing the folder you indicated me but there was no change...:-(. Please find below the log file you asked for:
    Log Session: Saturday, August 30, 2008 3:16:22 PM EEST
    System Info: Product Version = Sun Studio (Build 200704122300)
    Operating System = SunOS version 5.10 running on x86
    Java; VM; Vendor; Home = 1.5.0_16; Java HotSpot(TM) Client VM 1.5.0_16-b02; Sun Microsystems Inc.; /usr/jdk/instances/jdk1.5.0/jre
    System Locale; Encoding = en (sunstudio); ISO646-US
    Home Dir.; Current Dir. = /export/home/ioanp; /export/home/ioanp
    Installation; User Dir. = /opt/netbeans-5.5.1/nb5.5:/opt/netbeans-5.5.1/ide7:/opt/netbeans-5.5.1/harness:/opt/netbeans-5.5.1/cnd1:/opt/SUNWspro/atd1:/opt/SUNWspro/prod:/opt/netbeans-5.5.1/platform6; /export/home/ioanp/.sunstudio/12.0-SunOS-i386
    Boot & Ext. Classpath = /usr/jdk/instances/jdk1.5.0/jre/lib/rt.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/i18n.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/sunrsasign.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/jsse.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/jce.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/charsets.jar:/usr/jdk/instances/jdk1.5.0/jre/classes:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/dnsns.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/localedata.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/sunjce_provider.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/sunpkcs11.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jhall.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jmf.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jmplay.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/mediaplayer.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/multiplayer.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jai_codec.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jai_core.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/mlibwrapper_jai.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/clibwrapper_jiio.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jai_imageio.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/jmfmp3.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/mp3plugin.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/ext/gnome-java-bridge.jar
    Application Classpath = /opt/netbeans-5.5.1/platform6/lib/boot.jar:/opt/netbeans-5.5.1/platform6/lib/org-openide-modules.jar:/opt/netbeans-5.5.1/platform6/lib/org-openide-util.jar:/opt/netbeans-5.5.1/platform6/lib/locale/boot_ja.jar:/opt/netbeans-5.5.1/platform6/lib/locale/boot_pt_BR.jar:/opt/netbeans-5.5.1/platform6/lib/locale/boot_zh_CN.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-modules_ja.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-modules_pt_BR.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-modules_zh_CN.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-util_ja.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-util_pt_BR.jar:/opt/netbeans-5.5.1/platform6/lib/locale/org-openide-util_zh_CN.jar:/opt/netbeans-5.5.1/platform6/lib/locale/swing-l10n_pt_BR.jar
    Startup Classpath = /opt/netbeans-5.5.1/platform6/core/core.jar:/opt/netbeans-5.5.1/platform6/core/org-openide-filesystems.jar:/opt/netbeans-5.5.1/platform6/core/locale/core_pt_BR.jar:/opt/netbeans-5.5.1/platform6/core/locale/core_zh_CN.jar:/opt/netbeans-5.5.1/platform6/core/locale/org-openide-filesystems_ja.jar:/opt/netbeans-5.5.1/platform6/core/locale/org-openide-filesystems_pt_BR.jar:/opt/netbeans-5.5.1/platform6/core/locale/org-openide-filesystems_zh_CN.jar:/opt/netbeans-5.5.1/platform6/core/locale/core_ja.jar:/opt/netbeans-5.5.1/nb5.5/core/org-netbeans-upgrader.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/core_nb_ja.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/core_nb_pt_BR.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/core_nb_zh_CN.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/org-netbeans-upgrader_ja.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/org-netbeans-upgrader_pt_BR.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/org-netbeans-upgrader_zh_CN.jar:/opt/netbeans-5.5.1/nb5.5/core/locale/core_nb.jar:/opt/netbeans-5.5.1/ide7/core/org-netbeans-modules-utilities-cli.jar:/opt/SUNWspro/prod/atd1/core/locale/core_sunstudio.jar
    Turning on modules:
         org.openide.util [6.8.31 200704122300]
         org.openide.modules [6.5.31 200704122300]
         org.openide.awt [6.7.31 200704122300]
         org.openide.filesystems [6.4.31 200704122300]
         org.openide.dialogs [6.5.31 200704122300]
         org.openide.nodes [6.7.31 200704122300]
         org.openide.windows [6.5.31 200704122300]
         org.openide.options [6.4.31 200704122300]
         org.openide.text [6.9.32 200704122300]
         org.openide.explorer [6.5.31 1 200704122300]
         org.openide.actions [6.5.31 200704122300]
         org.openide.loaders [5.9.31 200704122300]
         org.netbeans.api.xml/1 [1.13.30 200704122300]
         org.netbeans.spi.navigator/1 [1.2.31 200704122300]
         org.openide.io [1.9.31 200704122300]
         org.netbeans.core.output2/1 [1.7.31.1 1 200704122300]
         org.netbeans.modules.xml.core/2 [1.12.30.4 4 200704122300]
         org.netbeans.bootstrap/1 [2.3.31 200704122300]
         org.netbeans.core.startup/1 [1.5.31 200704122300]
         org.netbeans.swing.plaf [1.5.31 200704122300]
         org.netbeans.core/2 [3.2.31.1 200704122300]
         org.netbeans.libs.xerces/1 [1.8.32 2.8.0 200704122300]
         org.netbeans.modules.xml.tax/2 [1.12.30.4.4 4 200704122300]
         org.openide.execution [1.8.31 200704122300]
         org.netbeans.api.java/1 [1.10.31 200704122300]
         org.netbeans.modules.editor.util/1 [1.8.31 200704122300]
         org.netbeans.modules.editor.mimelookup/1 [1.3.31 200704122300]
         org.netbeans.modules.editor.fold/1 [1.5.31 200704122300]
         org.netbeans.modules.editor.lib/1 [1.9.31.1 1 200704122300]
         org.netbeans.modules.editor.plain.lib/1 [1.3.31 200704122300]
         org.netbeans.modules.queries/1 [1.7.31 200704122300]
         org.openidex.util/3 [3.9.32 200704122300]
         org.netbeans.modules.editor.settings/1 [1.4.31 200704122300]
         org.netbeans.modules.editor/3 [1.26.31.1 200704122300]
         org.netbeans.modules.editor.plain/1 [1.3.31 200704122300]
         org.netbeans.core.ui/1 [1.9.31 200704122300]
         org.netbeans.modules.settings/1 [1.10.51 200704122300]
         org.netbeans.modules.projectapi/1 [1.9.31 200704122300]
         org.netbeans.modules.cnd.api.model/1 [1.1.1 1 070814]
         org.jdesktop.layout/1 [1.3.41 1.0 200704122300]
         org.netbeans.api.progress/1 [1.5.31 200704122300]
         org.netbeans.libs.formlayout/1 [1.2.31 1 200704122300]
         org.netbeans.modules.options.api/0 [1.3.31 200704122300]
         org.netbeans.modules.cnd/1 [1.1.1 1 070814]
         org.netbeans.modules.projectuiapi/1 [1.13.32.5 5 200704122300]
         org.netbeans.modules.project.ant/1 [1.12.31 200704122300]
         org.netbeans.modules.cnd.makeproject/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.discovery [1.1.1 070814]
         org.netbeans.modules.cnd.modeldiscovery [1.1.1 070814]
         org.netbeans.modules.javahelp/1 [2.8.31 200704122300]
         org.netbeans.modules.diff/1 [1.15.31.42 42 200704122300]
         org.netbeans.modules.editor.errorstripe.api/1 [2.2.31.1 1 200704122300]
         org.netbeans.modules.editor.errorstripe/2 [2.2.31.1.1 1 200704122300]
         org.netbeans.modules.versioning/1 [1.3.31.1 1 200704122300]
         org.netbeans.lib.cvsclient/1 [1.14.31 200704122300]
         org.netbeans.modules.masterfs/1 [1.8.33 200704122300]
         org.netbeans.core.execution/1 [1.9.31 200704122300]
         org.apache.tools.ant.module/3 [3.24.31.1 1 200704122300]
         org.netbeans.libs.jsch/1 [1.4.31 0.1.24 200704122300]
         org.netbeans.modules.versioning.system.cvss/1 [1.7.31.1.42.1 1 200704122300]
         org.netbeans.modules.cnd.modelutil/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.qnavigator/1 [1.1.1 070814]
         org.netbeans.modules.cnd.antlr [2.7.5 070814]
         org.netbeans.modules.cnd.repository.api/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.apt [1.1.1 1 070814]
         org.netbeans.modules.cnd.dwarfdump [1.1.1 070814]
         org.netbeans.modules.xml.xam/1 [1.1.30 1 200704122300]
         org.netbeans.modules.favorites/1 [1.11.41 200704122300]
         org.apache.xml.resolver [1.1.30 1.1 200704122300]
         org.netbeans.modules.xml.catalog/2 [1.11.30.4.4 4 200704122300]
         org.netbeans.modules.projectui [1.9.10.5 200704122300]
         org.netbeans.modules.editor.bookmarks/1 [1.3.31 200704122300]
         com.sun.tools.swdev.advtools.actions.api [1.1.1 070730]
         org.netbeans.modules.cnd.folding [1.1.1 1 070814]
         org.netbeans.tasklistapi/1 [1.20.31.7 7 200704122300]
         org.netbeans.modules.tasklist.core/2 [1.37.31.16.7 16 200704122300]
         org.netbeans.modules.suggestions_framework/2 [1.15.31.9.16.7 9 200704122300]
         org.netbeans.modules.tasklist.docscan/2 [1.23.31.9.16.7 200704122300]
         org.netbeans.modules.ant.grammar/1 [1.14.31 200704122300]
         org.netbeans.modules.cnd.dwarfdiscovery [1.1.1 070814]
         org.netbeans.modules.cnd.highlight [1.1.1 070814]
         org.netbeans.lib.terminalemulator [1.3.1 070814]
         com.sun.tools.swdev.sunstudio.update/1 [1.1.1 070730]
         org.netbeans.modules.servletapi/1 [1.10.30 200704122300]
         org.netbeans.modules.editor.completion/1 [1.6.31 200704122300]
         org.netbeans.spi.palette/1 [1.6.10 200704122300]
         org.netbeans.modules.cnd.model.services/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.completion/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.gotodeclaration [1.1.1 070814]
         org.netbeans.modules.xml.schema.model/1 [1.1.30 1 200704122300]
         org.netbeans.modules.xml.wsdl.model/1 [1.1.30 1 200704122300]
         org.netbeans.modules.editor.codetemplates/1 [1.2.31 200704122300]
         org.netbeans.modules.cnd.modelimpl/1 [1.1.1 1 070814]
         org.netbeans.modules.css/2 [1.12.30 200704122300]
         org.netbeans.modules.image/1 [1.17.31 200704122300]
         org.netbeans.modules.editor.structure/1 [1.12.30.1 1 200704122300]
         org.netbeans.modules.xml.text/2 [1.12.30.4.4 4 200704122300]
         org.netbeans.modules.xml.retriever/1 [1.0.20 200704122300]
         org.netbeans.modules.cnd.classview/1 [1.1.1 1 070814]
         org.netbeans.modules.cnd.modelui [1.1.1 070814]
         org.netbeans.modules.utilities/1 [1.21.32 200704122300]
         org.netbeans.modules.utilities.project/1 [1.5.33 200704122300]
         org.netbeans.swing.tabcontrol [1.6.31 200704122300]
         org.netbeans.core.windows/2 [2.7.31.1 200704122300]
         org.netbeans.modules.httpserver/2 [2.6.30.42 42 200704122300]
         org.netbeans.modules.xsl/1 [1.12.30.4 200704122300]
         org.openide.src [1.8.31 200704122300]
         org.netbeans.modules.xml.tools/2 [1.12.30.4.4.4 4 200704122300]
         com.sun.tools.swdev.toolscommon [1.16.0.2 ${bm.build.name} ${bm.build.date}]
         com.sun.tools.swdev.sunstudio/1 [1.1.1 070730]
         org.netbeans.spi.viewmodel/2 [1.9.31 200704122300]
         org.netbeans.api.debugger/1 [1.7.33 200704122300]
         org.netbeans.spi.debugger.ui/1 [2.8.33 200704122300]
         com.sun.tools.swdev.advtools.actions.spi [1.1.1 070730]
         com.sun.tools.debugger.dbxgui/3 [3.0.0.2 FCS 2007/08/06]
         org.netbeans.modules.html.editor.lib/1 [1.5.30 200704122300]
         org.netbeans.modules.html.editor/1 [1.5.30 200704122300]
         org.netbeans.modules.properties/1 [1.17.31 200704122300]
         org.netbeans.modules.xml.xdm/1 [1.1.30 1 200704122300]
         org.netbeans.modules.cnd.repository [1.1.1 070814]
         org.netbeans.upgrader [4.5.31 200704122300]
         com.sun.tools.swdev.projectimport/1 [1.1.1 070730]
         org.netbeans.modules.defaults/1 [1.2.31 200704122300]
         org.netbeans.modules.html/1 [1.20.30 200704122300]
         org.netbeans.modules.xml.schema/1 [1.12.30.4 200704122300]
         org.netbeans.modules.editor.settings.storage/1 [1.4.31 200704122300]
         org.netbeans.modules.autoupdate/1 [2.16.31 200704122300]
         org.netbeans.modules.options.editor/1 [1.2.31 200704122300]
         org.netbeans.modules.properties.syntax/1 [1.17.31 200704122300]
         org.netbeans.configuration.api [1.1.1 070814]
         com.sun.tools.swdev.advtools.actions.control [1.1.1 070730]
         org.netbeans.core.ide/1 [1.9.31 200704122300]
         com.sun.forte.st.mpmt/1 [8.2]
         com.sun.tools.swdev.advtools.actions.performanceanalyzeractions/1 [1.1.1 070730]
         org.netbeans.modules.extbrowser/1 [1.10.30 200704122300]
    ConfigurationDescriptorProvider: I/O in EQ is not good idea
    THANKS AGAIN AND REGARDS,
    John

  • Where are all the java source files located at on the server for 11.5.10?

    Hello,
    I found the object code file "MOLine.class" under the "/localapps/prodcomn/java/oracle/apps/inv/mo/server" directory on the server. But I simply could not find its source file "MOLine.java". Could someone please tell me where I can find all the java source code on the server? This is for Oracle Apps 11.5.10.
    Regards,
    Smita

    An error occured when trying to open the file for reading. Filename: ".\jad\tmp\MOLine.java"
    Current Working Directory: C:\Program Files\Cavaj Java Decompiler\
    System error message: The system cannot find the file specified.
    C++ exception: ios: failbit setDo you get the same error if you use a directory name which has no space in name?
    Question is, when I am trying to decompile MOLine.class to produce MOLine.java, why is it looking for MOLine.java?Most probably because you cannot decompile the class file (I believe if it was possible, Oracle would have provided the java file).
    Thanks,
    Hussein

  • Generating a Report from a Servlet in a new Browser using javascript:

    Hi, folks,
    I'm facing an intersting problem:
    I have the servlet below that generates a new browser with a click of a button.
    But if the parameter of the function gera(), have the caracter ' (pics), for example:
    gera( '<img src='name'>' ), the function doesn't work.
    I need to solve that with some urgent...
    Thanks,
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class TesteRel extends HttpServlet {
         public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    StringBuffer ret = new StringBuffer();
    res.setContentType( "text/plain" );
    PrintWriter out = res.getWriter();
    ret.append( "<html>" );
    ret.append( "<head>" );
    ret.append( "<script>" );
    ret.append( " function gera( text ) {" );
    ret.append( " rel = window.open('toolbar=1, location=0, directories=0, status=1, resizable=0, screenx=0, screeny=0, left=0, top=0, width=970, height=600');" );
    ret.append( " rel.document.open();" );
    ret.append( " rel.document.write('<html><body>');" );
    ret.append( " rel.document.write( texto ) ; ");
    ret.append( " rel.document.write('</body></html>');" );
    ret.append( " rel.document.close();" );
    ret.append( " rel.focus();" );
    ret.append( " }" );
    ret.append( "</script>" );
    ret.append( "</head>" );
              ret.append( "<body>" );
              ret.append( " <h1> Testing an function in javascript that shows an Report in a new Browser:</h1> " );
              ret.append( "<form>" );
              ret.append( " <input type='button' value='Type 3 to close' onclick='javascript:gera( '<img src='bradesco.gif'><br><h1>teste</h1>' ) ;'>" );
              ret.append( "</form>" );
              ret.append( "</body></html>" );
              out.write( ret.toString() );
              out.close();
    }

    You can mix " and ' in javascript provided they are paired in the correct order.
    so try
    gera('<img src="name">')
    Use the escape character \" when including or outputting double quotes from java.

Maybe you are looking for