Processing a jsp file through a servlet first

At my company we have a lot of code tied up in servlets for our website. We would like to integrate JSPs along side the servlet architecture. We need to process the html files though both our serlvet architecture (Our website menu system and security are handled here) and the jsp tags.
Here is what currently happens. We write a webpage, the servlet archtecture process the pages, doing substitutions on specific objects and running code in specific objects to build the html that is sent to the users browser. Instead of immediately sending the output to the users browser, i'd like to process it through the jsp servlet first. How would I go about running the newly substituted code through the jsp engine?
Thanks in advance,
Jeff

That I probably wasn't clear enough with what is happening on our site.
Let me walk you through how our site works.
Here is an extremely simple page, and i'll walk you through what happens.
<HTML>
<HEAD></HEAD
<BODY>
Welcome {!s:username!}
<!--#SQLLOOP name="SELECT" QUERY="SELECT year, name FROM programs where program_group_id = 35"-->
{!r:select:name!}--- {!r:select:year!}
<!--#/SQLLOOP-->
</BODY>
</HTML>When that page is called, the servlet starts. It opens up the file, does a substitiution on {!s:username!} for the username variable from session data. It then will execute a javaclass for the SQLLLOOP statement and output the year and name for all values where the program_group_id = 35. After the substitutions are done, then spits the html back at you.
Now what I would like to do is to get this code to play nice with JSPs.
the <jsp:include> tag does not appear to work.

Similar Messages

  • How to call a function defined in a JSP file into a servlet?

    Hi
    I have defined a JSP file with some functions in it. I am including this JSP file into other JSP files so that these functions can be used. Now is there soe way, that I can include this file in a servlet as well and use the defined functions in the servlet as well.
    Thanks and Regards
    Vikram

    I assume you have a function with OUT arguments because you need to return at least two distinct things from this function? The functions return value and this OUT argument, too. Right? For the sake of argument, let's say that you're trying to return a VARCHAR2 value and a NUMBER value from this function.
    Assuming that you cannot just wrap your existing function with a function that does not have OUT arguments, the first idea that pops to mind is to create an Oracle8 type that looks like:
    CREATE TYPE MYREC AS OBJECT (V VARCHAR2(80), N NUMBER);Then you could rewrite your function to return an instance of this MYREC type instead of having one return value and one OUT parameter.
    Then create a BC4J domain for this Oracle8 type (which will mimic its nested structure), and then you can just select the value straight-away in your view object.
    I just tried this idea with 9.0.2 production and it works.
    The Domain you create will have getV() and getN() accessors on it so you can get at the nested values in the MyRec domain "record" structure.
    The other way would involve building a programmatic view object that sources the data for your VO programmatically. If I think of anything else I'll post something here.

  • Cannot find JSP file through web.xml

    Content of a.jsp
    function Thisthing (id, name) {
    this.id = id;
    this.descr = name;
    I want to access a.jsp from b.jsp. like
    <script type="text/javascript" src="a.js"></script>
    I have web.xml content
    <servlet>
    <servlet-name>DomainObjectis</servlet-name>
    <jsp-file>/a.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
    <servlet-name>DomainObjectis</servlet-name>
    <url-pattern>*.js</url-pattern>
    </servlet-mapping>
    However its showing me an error -> .Thisthing undefined whenever I run this in Tomcat 5.5.
    I appears its not finding my a.jsp file. It's working fine when I do
    <%@ include file="a.jsp" %>

    thanks for replying jgalacambra.
    I have deployed several web applications before. But this is the first one where I am trying to include a JSP file as a javascript.
    tomcat recognizes when I simply including the jsp file with import but when I try to include it as a script it's not working. So I am hoping that there are some experts here who can help me. I saw this being done in a project and am trying to build a similar web application myself.

  • How to call a jsp file from an servlet and access the jsp file objects??

    Hi everybody
    I have an jsp file where it contains a vector object with some data and I have a servlet that needs to access this vector object . How can my servlet call for this jsp page and get the vector object. ?
    then an applet will be calling this servlet to get some other object created with the data contained within this vector object...so each time Applet ask the servlet for the object the servlet need to call for this jsp page somehow
    My main question is the communication servlet-jsp
    please if u have any clue I will appreciate it
    thanks

    Hi
    There are several ways to share objects between JSPs/Servlets.
    You can share objects by putting them in the request-in which case the objects lifetime is limited by that of the request, Another way is to store them in the session, againg the lifetime is limited by the lifetime of the session. To have objects that have to persistent over the application life-span use the servletContext to store the objects.
    Any good tutorial should help you get started. Please see the link below for a tutorial on Servlets/JSPs
    Note: Local variables in the JSP cannot be shared with other components as their scope is limited to that particular Page/Servlet.
    Link: http://java.sun.com/docs/books/tutorial/servlets/
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems inc
    http://www.sun.com/developers/support

  • How to upload files through a servlet/jsp form?

    anyone know basically how to do this?
    i need to write a simple jsp form the can browse for a file on my machine, then upload it to a server in the usual html form manner.
    is this done with an i/o stream?
    thanks for any help!
    robSmyth
    [email protected]

    jspSmart has a free upload component you can use for HTTP file uploading. (http://www.jspsmart.com )
    Also, O'Reilly has an open source package you can use. (http://www.oreilly.com or http://www.servlets.com )
    Another option is dotJ, which has an upload tag in its tag library. Benefit of this library is that it has a much more compehensive set of JSP tags. (http://www.dotjonline.com )

  • Howto process non .jsp files wiht the jsp processor?

    I am building an application that uses a tag to include some resources to the page. This tag simple get in the context the bean assossiated with the tag and include it in its own stead.
    An engine process the request setting in the request scope a bean to be used by the tag. For the above example it would do:
    request.setAttribute( bean.getName(), bean );For example, in a given teen.jsp page I would have a tag:
    <sgc:resource name="menu" />One of the beans properties is the uri of the resource being included, this is configurable with a XML file, so that if I have the entry(it is cleaned out from non related stuff):
                <page name="teen.page"
                    wireframe="teen.jsp"
                    region="SP,RJ" >
                    <description>Descri��o da p�gina.</description>
                    <resource name="menu" location="menu.cnt" region="SP,RJ"/>
                    <resource name="content" location="teen1.cnt" region="SP"/>
                    <resource name="content" location="teen2.cnt" region="RJ"/>
                </page>When a request for teen.page reach the server, the engine find out the user data and create beans according to it, for example if it is from SP, the engine will populate a resource bean with the location set to teen1.cnt and will forward the request to teen.jsp. In teen.jsp there will be tag that will include teen1.cnt.
    All of this works fine as long as I don't use serverside tags in the cnt files. Yet I need the cnt files to be JSP processed.
    I searched for it in this forum and I googled for it, the closer answer I got for this was:
    http://www.jguru.com/faq/view.jsp?EID=254460
    I tryied it, but the server give me a error telling:
    javax.servlet.ServletException: Wrapper cannot find servlet class org.apache.jasper.runtime.JspServlet or a class it depends on
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)I am using tomcat 5.0.28 and this class seem to be part of it. I didn't found any solution to this. Anyone has any sugestion?
    As a side note, if I use .jsp as an extention to my resources, everything goes fine, but I would prefer to use cnt unless I cant solve this.
    Thanks for your time,
    Notivago.
    May the code be with you.

    Hello there!!
    Thanks for the help. I assigned dukes for you both. The change in the web.xml in the tomcat's conf directory did worked well. This web.xml already has a servlet defined:
        <servlet>
            <servlet-name>jsp</servlet-name>
            <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
            <init-param>
                <param-name>fork</param-name>
                <param-value>false</param-value>
            </init-param>
            <init-param>
                <param-name>xpoweredBy</param-name>
                <param-value>false</param-value>
            </init-param>
            <load-on-startup>3</load-on-startup>
        </servlet>and I just had to add mine:
    <servlet-mapping>
            <servlet-name>jsp</servlet-name>
            <url-pattern>*.cnt</url-pattern>
        </servlet-mapping>In my previous attempt I had to add both entries to the application web.xml, but as it was stated in the previous post it didn' t worked. I guess that diferent class loaders are used for eache one of this and the class org.apache.jasper.servlet.JspServlet isn't avaiable to the deployed application.
    Thanks again,
    Notivago.
    May the code be with you.

  • Streaming files through a Servlet to macintosh clients

    Hi,
    I have a servlet which streams diffrent kind of files to the client. I works perfectly with Windows and IE5.0,6.0 and Firefox. But on macintosh (IE5.2) the file name is the name of the servlet. In example if the servlet is named getFile, the file name used by the macintosh client to save the file will be getFile.
    Does anyone know the trick to make macintosh clients corretly resolve the filename/mime type??
    Thanks

    I finally figured out that setting my conent type like this:
    response.setContentType("application/octet-stream");
    works.
    But now I'm stuck with another little problem, Mac does not seem to convert the %20 is filenames to spaces.
    Any suggestions?

  • How can i include a jsp file in servlet?

    hi
    i generate a dynamic page from servlet.
    i need to include a jsp file in same servlet.
    i try like this --
    out.println("<HTML>");
    out.println("<HEAD><TITLE>First</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("<%@ include file=\"abc.jsp\">");
    out.println("<FORM>");
    out.println("</FORM>");
    out.println("</BODY>");
    out.println("</HTML>");

    Replace your line with
    RequestDispatcher rd = request.getRequestDispatcher("abc.jsp");
    rd.include(request, response);

  • Executing *.xml files as *.jsp files

    Under other web containers this usually takes about 4 lines in a config xml file.
    I am still hunting through the online doco
    but I was wondering if anyone could point
    me to the relevant section quicker ? ...
    Basically what I am looking to do is to
    tell the server to parse and execute *.xml
    files as *.jsp files. It should be a simple
    mapping somewhere in the config files.
    Thankyou in advance,
    Brian.

    Chuck,
    That isn't quite what I want to achieve. What I have done
    elsewhere is place the following servlet mapping in the Web
    Container's web.xml file.
    <servlet-mapping>
    <servlet-name>jsp</servlet-name>
    <url-pattern>*.xml</url-pattern>
    </servlet-mapping>
    which then causes all *.xml files to be processed as *.jsp files.
    Servlet name being the name of the servlet that processes the
    JSP files for the web container. Is there an equivalent
    thing under BEA ? Does BEA have a servlet which processes
    JSP files or does it use something different ?
    Cheers,
    Brian.
    "Chuck Nelson" <[email protected]> wrote:
    >
    Brian,
    You should be able to update the web.xml for this purpose
    e.g.
    <servlet>
    <servlet-name>myFoo</servlet-name>
    <jsp-file>SnoopServlet.xml</jsp-file>
    </servlet>
    See the following URL for a more detailed description
    http://edocs.bea.com/wls/docs61/webapp/components.html#100437
    Chuck Nelson
    DRE
    BEA Technical Support

  • Error accessing JSp file from Tomcat4.1.27 at line:-1 in the jsp file: null

    Hi...when I tried to access my JSp file from tomcat 4.1.27 web server, I got the following error message. Can anyone help me out?
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Tomcat\work\Standalone\localhost\Tree\jspfiles\tree_jsp.java:8: '.' expected
    import java;
    ^
    C:\Tomcat\work\Standalone\localhost\Tree\jspfiles\tree_jsp.java:80: illegal start of expression
    private static java.util.Vector jspxincludes;
    ^
    C:\Tomcat\work\Standalone\localhost\Tree\jspfiles\tree_jsp.java:82: illegal start of expression
    public java.util.List getIncludes() {
    ^
    C:\Tomcat\work\Standalone\localhost\Tree\jspfiles\tree_jsp.java:280: '}' expected
    ^
    4 errors
         at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
         at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
         at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:534)

    You JSP has four compile errors:
    C:\Tomcat\work\Standalone\localhost\Tree\jspfiles\tree_jsp.java:8: '.' expected
    import java;Invalid import. You need to import a whole package (*) or single class.
    import java; is wrong
    import java.util.*; is right
    import java.util.List; is right
    C:\Tomcat\work\Standalone\localhost\Tree\jspfiles\tree_jsp.java:80: illegal start of expression
    private static java.util.Vector jspxincludes;
    C:\Tomcat\work\Standalone\localhost\Tree\jspfiles\tree_jsp.java:82: illegal start of expression
    public java.util.List getIncludes() {Check the lines before these to make sure you didn't leave off a semi-colon, parens (')') or bracket ('}').
    C:\Tomcat\work\Standalone\localhost\Tree\jspfiles\tree_jsp.java:280: '}' expectedYou are missing a closing bracket ('}') somewhere.
    The message about the "line -1" error is the standard message that is always given when there are compile errors in the JSP.

  • How to parse jsp file

    What is the way to prase a JSP file which is in the local drive using a parser inorder to extract some information?.
    For example :
    <%@ page info=" hello world " %>
    <html>
    <head><title>Hello, World</title></head>
    <body bgcolor="blue" >
    <%@ include file="index.html" %>
    <table>
    <tr>
    <td width=150> </td>
    <td width=250 align=right> <h1>Hello, World!</h1> </td>
    </tr>
    </table>
    </body>
    </html>
    What i want to do is to print the "title" of the page and the "file" which is in the tag <%@ include file="index.html" %>.
    Thank you in advance.

    A JSP file is run, not parsed.Ususally a servlet source is generated from the jsp file, it is compiled, and run. Now in order to turn the jsp file into a servlet (code), it has to be (at least partially) parsed first.

  • Opening multiple excel files thorugh a servlet

    Hi
    In my system , i have excel reports in my server disk . And i am opening the excel files through an servlet class like /viewReport.do?id=23 .....and thus from the servlet will open my excel file .
    After opening one excel file , i try to open another excel by clicking that link , then my system often hangs else excel shows an error saying "a report with name viewReport.do is already open " even though both of these files are different on the server
    How can i avoid this ??
    The reason why i am opening the excel file through a servlet is , i need to perform some operations before opening that excel report
    Can any one let me know how to go abt this ??

    I had a similar porblem....
    I got some help from...http://www.javaworld.com/javaworld/jw-10-2006/jw-1019-xmlexcel.html?page=1...
    This is my code in servlet...
    HSSFWorkbook wb = new HSSFWorkbook();
         HSSFSheet spreadSheet = wb.createSheet("Users");
         spreadSheet.setColumnWidth((short) 0, (short) (256 * 25));
         spreadSheet.setColumnWidth((short) 1, (short) (256 * 25));
    //     Creating Rows
         HSSFRow row = spreadSheet.createRow(0);
         HSSFCell cell = row.createCell((short) 1);
         cell.setCellValue("Year 2005");
         cell = row.createCell((short) 2);
         cell.setCellValue("Year 2004");
         HSSFRow row1 = spreadSheet.createRow(1);
         HSSFCellStyle cellStyle = wb.createCellStyle();
    cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);
    cell = row1.createCell((short) 0);
    cell.setCellValue("Revenue ($)");
    cell = row1.createCell((short) 1);
    cell.setCellValue("25656");
    cell = row1.createCell((short) 2);
    cell.setCellValue("15457");
    FileOutputStream output = new FileOutputStream(new File("/tmp/Users.xls"));
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment;filename=Users.xls");
    ServletOutputStream out = response.getOutputStream();
    wb.write(output);
    output.flush();
    output.close();
    forward = null;
    In firefox i get the download dialog box but not able to open in from there,i need to save it and then open. In IE i dont get the dialog box instead the excell open inside the browser......Please help me to open a excel sheet onclick on a link "Export to excel" in jsp......
    Thanks in advance...
    Message was edited by:
    onlycoding

  • IPlanet WebServer Hangs on JSP file change

    Hello,
    I am using IPlanetWebServer-Enterprise/4.1SP5 and the server just hangs when there is a JSP file changed after the first successfull load. Looking at ther errors log, I can see that it is doing:
    compileJSP(): invoking Java compiler, file =/.....
    When the first time its successful, it follows that compilsJSP() with
    For JSP Compilation : JDKLocation-/usr/java/, fork_java_c=no,enable_debug=yes
    Is there a fix for this problem?? Please help
    Thanks

    I did all of the 3 things that you told me in the context.properties file.
    The same behavior is still happening....here is the sequence
    1) start the server from scratch
    2) load the jsp file (ok)
    3) change the jsp file with emacs
    4) reload the jsp file (ok, see the changes)
    5) change ths jsp file with emacs again
    6) reload the jsp file (HANGS, browser is just waiting for reply)
    errors file trace...
    04/Mar/2002:11:49:44] info (12964): Service(): uri=/seehawk/optimizer/jsp/omCost.jsp cgiScriptName=/seehawk/optimizer/jsp/omCost.jsp token=null cached=false
    [04/Mar/2002:11:49:44] info (12964): JSP: This is a jsp 1.x file
    [04/Mar/2002:11:49:44] info (12964): JSP: Before JSP1x compiler.compile, servletName = /seehawk/optimizer/jsp/omCost.jsp servletPath = /usr/local/home/gasweb/seehawk/optimizer/jsp/omCost.jsp & dir = ../ClassCache
    [04/Mar/2002:11:49:44] info (12964): JSP1x Jasper Trace: Package name is: jsps.seehawk._optimizer._jsp
    [04/Mar/2002:11:49:44] info (12964): JSP1x Jasper Trace: Class name is: omCostjsp
    [04/Mar/2002:11:49:44] info (12964): JSP1x Jasper Trace: Java file name is: /usr/local/netscape/server4/https-kw_chan/config/../ClassCache/_jsps/_seehawk/_optimizer/_jsp/_omCost_jsp.java
    [04/Mar/2002:11:49:44] info (12964): JSP1x Jasper Trace: Class file name is: /usr/local/netscape/server4/https-kw_chan/config/../ClassCache/_jsps/_seehawk/_optimizer/_jsp/_omCost_jsp.class
    [04/Mar/2002:11:49:45] info (12964): JSP1x Jasper Trace: Compiling with: -classpath /usr/local/soap-2_2:/usr/local/xerces-2_0_0/xercesImpl.jar:/usr/local/xerces-2_0_0/xmlParserAPIs.jar:/usr/local/soap-2_2/lib/soap.jar:/usr/local/:/usr/local/netscape/server4/plugins/samples/servlets/beans.10/SDKBeans10.jar:/usr/local/netscape/server4/plugins/samples/servlets/beans/SDKBeans.jar:/usr/local/netscape/server4/bin/https/jar/Bugbase.jar:/usr/local/netscape/server4/bin/https/jar/Calljsac.jar:/gasweb:/usr/local/netscape/server4/webagent/java/SafeAdapter.jar:/usr/local/netscape/server4/webagent/java/SafeAdapterHelper.jar:/usr/local/netscape/server4/webagent/java/env.jar:/usr/local/netscape/server4/webagent/java/jsafe.jar:/usr/local/netscape/server4/webagent/java/msr.jar:/usr/local/netscape/server4/webagent/java/smjavaagentapi.jar:/usr/local/netscape/server4/webagent/java/smjavasdk.jar:/usr/local/netscape/server4/bin/https/jar/NSServletLayer.jar:/usr/local/netscape/server4/bin/https/jar/NSJavaUtil.jar:/usr/local/netscape/server4/bin/https/jar/NSJavaMiscUtil.jar:/usr/local/netscape/server4/bin/https/jar/servlets.jar:/usr/local/netscape/server4/bin/https/jar/jsp092.jar:/usr/local/netscape/server4/bin/https/jar/xml.jar:/usr/local/netscape/server4/bin/https/jar/jspengine.jar:/usr/local/netscape/server4/bin/https/jar/SSJS.jar:/usr/local/netscape/server4/bin/https/jar/js14lc30.jar:/usr/local/netscape/server4/bin/https/jar/ldapjdk.jar:::../ClassCache:/usr/local/netscape/server4/https-kw_chan/config/../ClassCache -d /usr/local/netscape/server4/https-kw_chan/config/../ClassCache /usr/local/netscape/server4/https-kw_chan/config/../ClassCache/_jsps/_seehawk/_optimizer/_jsp/_omCost_jsp.java
    [04/Mar/2002:11:49:45] info (12964): IWSJavaC.compile(): forking external compiler, java=/usr/java//bin/javac
    Thanks
    Ka-Wai

  • "Java file" & "Jsp file" compilation issues in Eclipse

    Hi,
    Eclipse
    Question 1:
    I have set the value for preference->java->Installed JREs as : j2re1.4.2_07 not to jdk
    When I write a java file, its compiling, how? From where its using "javac" exe file for compilation.
    Question 2:
    Whereas in prefrence->Tomcat->JVMSettings -> JRE(drop down box) set value as j2re.1.4.2_07
    When I write a jsp file as follows
    index.jsp
    <html>
    <body>
    <%java.util.Date d = new java.util.Date();%>
    Todays date is <%= d.getDate()%> and this jsp page worked!
    </body>
    </html>
    when i try to save this file & strat tomcat I got exception as follows:
    Exception:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    Please clear my doubts.
    Thanks,
    Hari

    Try going into your TOMCAT_HOME/conf/web.xml and look for this section:
    <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
    <param-name>logVerbosityLevel</param-name>
    <param-value>WARNING</param-value>
    </init-param>
    <init-param>
    <param-name>fork</param-name>
    <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
    </servlet>
    Change the <param-value> for fork from false to true and see if that helps.
    Otherwise it's a problem with your JSP.

  • Include a jsp file for editing without compiling

    I am having trouble finding code to do this.
    I want to be able to edit a jsp file through my browser. I am to get everthing working except, the including of the jsp file itself. I have tried all the different types of includes, but they all compile the file. I want to be able to edit the source.
    Can anybody help me with this?
    Thanks
    Mossybreen

    I'm not totally clear on what you're trying to do.
    If you just want to be able to edit JSP source code and save it back to the file, you could probably create a page with a form that reads the file, dumps the text into a textarea, then writes it back to the file when you submit, although, personally, I wouldn't leave anything that dangerous on a public server in a million years. You'd be better off setting up WebDAV access or sFTP or something if you really need to edit your source code remotely. There's also a product from Macromedia called Contribute that allows you to do this, and there's another company that makes an applet that creates a WYSIWYG HTML editor in your browser. Unfortunately I can't remember the name, but it was pretty far from perfect anyway.

Maybe you are looking for

  • Troubleshooting kernel panics

    I'm trying to come up with as many solutions as possible for troubleshooting kernel panics. Let me know what I'm missing! Troubleshooting Kernel Panics in Mac OS X: Kernel Panics in Mac OS X can be caused by many things,including: Bad RAM Outdated so

  • How do I add a single app seat to my team plan

    Doesn't seem to be an option under add seat for it.

  • Reg Return PO Message

    Hi .. Requirement is i need to generate new message for return PO's, diff from normal PO we have message NEU[PO] and we also have return PO message ZNEU[Return PO] When i raise a normal PO, system automatically bringing both messages, one for actual

  • Kodo 3.1.0 Final Now Available

    All, Kodo 3.1.0 is now available! Get your copy while supplies last at http://www.solarmetric.com/Software/Evaluate/ ! This is a significant new release with much enhanced functionality. Highlights of 3.1.0 include: - Added the ability to use Kodo fr

  • Forgot backup password

    My brother never updates his ipod touch as it is always in his car for music. He brought it in recently and we updated it and itunes wiped it clean. We went to put everyone back on using the recent backup....but found he forgot his password. Wrote in