Importing Custom Classes into a JSP page

Hello,
I have created custom package com.srjgroup.report. It sits in C:\workspace\src\com\srjgroup\report directory. I have java files as well as compiled classes there. No jar files there.
did amend classpath to point to this directory.
In my JSP page I have the import statement as following
import="java.sql.*, java.util.*, java.text.SimpleDateFormat, com.srjgroup.report.*"It imports all the packages without any errors. However, when I try to use one of the classes in the package, I get error
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 3 in the jsp file: /SQLServer.jsp
Generated servlet error:
SRJReports cannot be resolved to a type
SRJReports is one of the classes that I am trying to use in that package. When I comment out all references to the class, everything is fine.
So, to fix this I moved the entire package to
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib direcory, preserving the hierarhy. So, now my custom package is located here:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib\com\srjgroup\report again there are no jar files, only java and classes here. Still, no go.
What am I doing wrong ?

Put the class in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\com\srjgroup\report
One more thing, there is no subdirectory in lib directory. You may look at the example within tomcat for reference. I start from there.

Similar Messages

  • Adding custom javascripts into my jsp pages

    Hi all,
    it will seems to be a newby question, i'm sorry i begin using jhs since two weeks
    the question is how can i Allow an onBlur property on VO Attributes; this property includes a piece of JavaScript to be executed on leaving the item to be generated in my jsp pages to prevent doing this in post-generation, by the way i would like to know who is the class responsible for the generation of form.js .
    thanks a lot
    best regards.
    Edited by: user1718070 on 3 févr. 2009 06:41

    Hi EvertJan, thanks for the reply.
    I need an advice:
    i've added an onblur event to jhsgenerator ADF BC property and i write as an example this.value=null
    i created a template in jspinput.xsl(JAGLauncher.jar) like this:
    <xsl:template name="onBlur">
    <xsl:param name="onBlur" />
    <xsl:if test="$onBlur !=''" >
    <xsl:attribute name="onblur">
    <xsl:value-of select="$onBlur" />
    </xsl:attribute>
    </xsl:if>
    </xsl:template>
    and i try to generate a html:text by modifing inputtextsec template like this:
    <xsl:template name="textInputSec">
    <xsl:param name="name"/>
    <xsl:param name="property"/>
    <xsl:param name="withIndex"/>
    <xsl:param name="size"/>
    <xsl:param name="maximumLength"/>
    <xsl:param name="updateable"/>
    <xsl:param name="displayType"/>
         <xsl:param name="onBlur" />
    <html:text name="{$name}" property="{$property}" size="{$size}" maxlength="{$maximumLength}" onblur="{$onBlur}">
    <xsl:call-template name="onBlur" >
    <xsl:with-param name="onBlur" select="$onBlur"/>
    </xsl:call-template>
              <xsl:if test="$withIndex = 'true'">
    <xsl:attribute name="indexed">
    <xsl:value-of select="'true'"/>
    </xsl:attribute>
    </xsl:if>
    <xsl:call-template name="disabledAttribute">
    <xsl:with-param name="updateable" select="$updateable"/>
    </xsl:call-template>
    </html:text>
         </xsl:template>
    also added this to CreateFormElement template in jsplibrary.xsl:
    <xsl:with-param name="onBlur" >
    <xsl:call-template name="getCustomProperty">
    <xsl:with-param name="entityAttribute" select="$entityAttribute"/>
    <xsl:with-param name="propertyName" select="'ON_BLUR'"/>
    </xsl:call-template>
    </xsl:with-param>
    but the result inemployees.jsp is not what i expected:
    <td class="prompt" nowrap="nowrap">FirstName</td>
    <td nowrap="nowrap">
    <html:text name="EmployeesBean" property="EmployeesFirstName" size="20" maxlength="30" onblur="" />
    </td>
    like yousee this.value=null is missing in onblur=""
    i hope you can help me
    Best regards

  • Importing java classes into jsp page

    I'm trying to import java classes inside my jsp page, while doing that i am getting compilation error "package uma.natarajan.javaclasses" not found. I don't know where to copy the java files. i'm keeping my jsp files under public_html folder
              

    Hi uma,
              create uma\natarajan\javaclasses under weblogic_home\myserver and copy java
              classes(u want to import) to uma\natarajan\javaclasses and then u try.
              Concept is the java classes u import should be present in a classpath. Hope
              this may help u,
              Arun,
              [email protected]
              "uma natarajan" <[email protected]> wrote in message
              news:3a490bcb$[email protected]..
              > I'm trying to import java classes inside my jsp page, while doing that i
              am getting compilation error "package uma.natarajan.javaclasses" not found.
              I don't know where to copy the java files. i'm keeping my jsp files under
              public_html folder
              

  • Importing visual jsf page into another jsp page

    Hi
    I am developing a web application using jsp and struts. I want to embed a visual jsf page that Ive created into another jsp page (which is a normal jsp page, not a jsf one.)
    Ive tried quite a few things but nothing seems to work..
    <jsp:include page="Page2.jsp">
    Ive surrounded the code in the f:subview tags. still doesnt work.
    Ive tried using <jsp:useBean id="Page2" scope="page" class="visualwebapplication.Page2" > .. It does not give me an error, but does not embed the page as well. Do I need to some other code after this to use the above bean to display the page.
    Any help would be greatly appreciated.
    Regards
    Sparsh Agarwal

    Hi
    This is the error message that is generated in the tomcat log once i try to load the homePage.do
    Jul 31, 2008 2:27:47 PM org.apache.catalina.core.ApplicationContext log
    SEVERE: Cannot forward after response has been committed
    java.lang.IllegalStateException: Cannot forward after response has been committed
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:302)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
            at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
            at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
            at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
            at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:320)
            at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
            at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
            at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
            at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.render(PartialTraversalLifecycle.java:106)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
            at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
            at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
            at org.apache.jsp.view.main_005fright_jsp._jspService(main_005fright_jsp.java:54)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
            at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
            at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
            at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:609)
            at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
            at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
            at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760)
            at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892)
            at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspx_meth_tiles_005finsert_005f5(layoutBase_jsp.java:255)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspService(layoutBase_jsp.java:120)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
            at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
            at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
            at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
            at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341)
            at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Thread.java:619)
    Jul 31, 2008 2:27:47 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet Faces Servlet threw exception
    java.lang.IllegalStateException: Cannot forward after response has been committed
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:302)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
            at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
            at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
            at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
            at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:320)
            at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
            at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
            at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
            at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.render(PartialTraversalLifecycle.java:106)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
            at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
            at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
            at org.apache.jsp.view.main_005fright_jsp._jspService(main_005fright_jsp.java:54)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
            at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
            at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
            at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:609)
            at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
            at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
            at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760)
            at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892)
            at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspx_meth_tiles_005finsert_005f5(layoutBase_jsp.java:255)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspService(layoutBase_jsp.java:120)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
            at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
            at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
            at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
            at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341)
            at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Thread.java:619)
    Jul 31, 2008 2:27:47 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.IllegalStateException: Cannot forward after response has been committed
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:302)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
            at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
            at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
            at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
            at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:320)
            at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
            at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
            at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
            at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.render(PartialTraversalLifecycle.java:106)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
            at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
            at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
            at org.apache.jsp.view.main_005fright_jsp._jspService(main_005fright_jsp.java:54)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
            at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
            at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
            at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:609)
            at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
            at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
            at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760)
            at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892)
            at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspx_meth_tiles_005finsert_005f5(layoutBase_jsp.java:255)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspService(layoutBase_jsp.java:120)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
            at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
            at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
            at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
            at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341)
            at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Thread.java:619)
    Jul 31, 2008 2:27:47 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: ServletException in '/view/main_right.jsp': Cannot forward after response has been committed
            at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
            at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspx_meth_tiles_005finsert_005f5(layoutBase_jsp.java:255)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspService(layoutBase_jsp.java:120)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
            at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
            at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
            at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
            at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341)
            at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Thread.java:619)
    Jul 31, 2008 2:27:47 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet action threw exception
    javax.servlet.jsp.JspException: ServletException in '/view/main_right.jsp': Cannot forward after response has been committed
            at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
            at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspx_meth_tiles_005finsert_005f5(layoutBase_jsp.java:255)
            at org.apache.jsp.view.templates.layoutBase_jsp._jspService(layoutBase_jsp.java:120)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
            at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
            at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
            at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
            at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341)
            at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Thread.java:619)

  • Custom tag in included JSP page cause exception (WLS 5.1 SP 9)

              An application use custom tags (JSP Tag extensions) in JSP page
              included into another JSP page by means <jsp:include> instruction.
              After we had installed Service Pack 9 for Weblogic 5.1
              browser's call of including JSP began show an error.
              When I remove Weblogic510sp9.jar and Weblogic510sp9boot.jar
              references from startWebLogic.cmd, the error diagnostic disappear.
              Is Service Pack Number 9 wrong?
              ==========================
              Web browser diagnostic:
              Error 500--Internal Server Error
              From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
              10.5.1 500 Internal Server Error
              The server encountered an unexpected condition which prevented it from fulfilling
              the request.
              ==========================
              Console diagnostic:
              Tue Jun 05 17:40:14 MSD 2001:<I> <WebAppServletContext-dscat> looking for taglib
              uri /exttags.tld as resource /WEB-INF/e
              xttags.tld in Web Application root:
              Tue Jun 05 17:40:15 MSD 2001:<I> <WebAppServletContext-dscat> Generated java file:
              C:\weblogic\dscat\WEB-INF\_tmp_war_ds
              cat\jsp_servlet\_jsp\_opos\_catalog.java
              Tue Jun 05 17:40:25 MSD 2001:<E> <WebAppServletContext-dscat> Servlet failed with
              Exception
              java.lang.VerifyError: (class: jsp_servlet/_jsp/_opos/_catalog, method: _jspService
              signature: (Ljavax/servlet/http/Http
              ServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Register 12 contains
              wrong type
              at java.lang.Class.newInstance0(Native Method)
              at java.lang.Class.newInstance(Unknown Source)
              at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:469)
              at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java,
              Compiled Code)
              at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:442)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:228)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              ==========================
              Including JSP file:
              <%@ include file="catalog_real.jsp" %>
              ==========================
              Included JSP file:
              <%@ taglib uri="/exttags.tld" prefix="dscat" %>
              <dscat:pageheader>Catalog header</dscat:pageheader>
              ==========================
              Tag extansions library (WEB-INF/exttags.tld file):
              <?xml version="1.0" encoding="ISO-8859-1" ?>
              <!DOCTYPE taglib
              PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
                   "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
              <taglib>
              <tlibversion>1.0</tlibversion>
              <jspversion>1.1</jspversion>
              <shortname>dscat</shortname>
              <tag>
              <name>pageheader</name>
              <tagclass>ru.ibs.xbcat.view.tag.PageHeader</tagclass>
              </tag>
              </taglib>
              ==========================
              Class PageHeader:
              package ru.ibs.xbcat.view.tag;
              import java.io.*;
              import javax.servlet.jsp.*;
              import javax.servlet.jsp.tagext.*;
              public class PageHeader extends BodyTagSupport {
              public int doStartTag() throws javax.servlet.jsp.JspException {
              return BodyTag.EVAL_BODY_TAG;
              public int doAfterBody() throws javax.servlet.jsp.JspException {
              return(SKIP_BODY);
              

              Are you using Jikes? See if this helps ...
              http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=6287&utag=
              Mike
              "Radik Usmanov" <[email protected]> wrote:
              >
              >An application use custom tags (JSP Tag extensions) in JSP page
              >included into another JSP page by means <jsp:include> instruction.
              >
              >After we had installed Service Pack 9 for Weblogic 5.1
              >browser's call of including JSP began show an error.
              >When I remove Weblogic510sp9.jar and Weblogic510sp9boot.jar
              >references from startWebLogic.cmd, the error diagnostic disappear.
              >
              >Is Service Pack Number 9 wrong?
              >==========================
              >Web browser diagnostic:
              >
              >Error 500--Internal Server Error
              >From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
              >10.5.1 500 Internal Server Error
              >The server encountered an unexpected condition which prevented it from
              >fulfilling
              >the request.
              >
              >==========================
              >Console diagnostic:
              >
              >Tue Jun 05 17:40:14 MSD 2001:<I> <WebAppServletContext-dscat> looking
              >for taglib
              >uri /exttags.tld as resource /WEB-INF/e
              >xttags.tld in Web Application root:
              >Tue Jun 05 17:40:15 MSD 2001:<I> <WebAppServletContext-dscat> Generated
              >java file:
              >C:\weblogic\dscat\WEB-INF\_tmp_war_ds
              >cat\jsp_servlet\_jsp\_opos\_catalog.java
              >Tue Jun 05 17:40:25 MSD 2001:<E> <WebAppServletContext-dscat> Servlet
              >failed with
              >Exception
              >java.lang.VerifyError: (class: jsp_servlet/_jsp/_opos/_catalog, method:
              >_jspService
              >signature: (Ljavax/servlet/http/Http
              >ServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Register 12
              >contains
              >wrong type
              > at java.lang.Class.newInstance0(Native Method)
              > at java.lang.Class.newInstance(Unknown Source)
              > at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:469)
              > at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java,
              >Compiled Code)
              > at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:442)
              > at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:228)
              > at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
              > at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
              > at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
              > at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
              > at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
              > at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              >Code)
              >
              >==========================
              >Including JSP file:
              >...
              > <%@ include file="catalog_real.jsp" %>
              >...
              >
              >==========================
              >Included JSP file:
              >...
              > <%@ taglib uri="/exttags.tld" prefix="dscat" %>
              >...
              ><dscat:pageheader>Catalog header</dscat:pageheader>
              >...
              >==========================
              >Tag extansions library (WEB-INF/exttags.tld file):
              >
              ><?xml version="1.0" encoding="ISO-8859-1" ?>
              ><!DOCTYPE taglib
              > PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
              >     "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
              >
              ><taglib>
              > <tlibversion>1.0</tlibversion>
              > <jspversion>1.1</jspversion>
              > <shortname>dscat</shortname>
              >
              > <tag>
              > <name>pageheader</name>
              > <tagclass>ru.ibs.xbcat.view.tag.PageHeader</tagclass>
              > </tag>
              >
              ></taglib>
              >==========================
              >Class PageHeader:
              >
              >package ru.ibs.xbcat.view.tag;
              >
              >import java.io.*;
              >import javax.servlet.jsp.*;
              >import javax.servlet.jsp.tagext.*;
              >
              >public class PageHeader extends BodyTagSupport {
              >
              > public int doStartTag() throws javax.servlet.jsp.JspException {
              > return BodyTag.EVAL_BODY_TAG;
              > }
              >
              > public int doAfterBody() throws javax.servlet.jsp.JspException {
              > ...
              > return(SKIP_BODY);
              > }
              >}
              >
              

  • How to use self-defined class in a jsp page

    Hello:
    I defined a class for displaying purpose, which is in the different folder(WEB-INF/classes) from my JSP page.
    In my JSP page, I want to create an instance of my class and display something, while I get the following error: "
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 12 in the jsp file: /htmls/templateIntro.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    /home/jiao/jsp_webserver/tomcat/work/Standalone/localhost/syllabus/htmls/templateIntro_jsp.java:72: cannot resolve symbol
    symbol : class Display
    location: class org.apache.jsp.templateIntro_jsp
    Display display=new Display(out);"
    How can I solve this problem? Should I redefine my classpath or there are some other actions I should take.
    T.I.A.
    Oriental Spirit

    Here is what I have done:
    1) in Display.java, add one line "package tools;" on the top, and compile it to
    create Display.class.
    2) create a new folder at
    /home/jiao/jsp_webserver/tomcat/webapps/syllabus/WEB-INF/classes
    named tools and then put the Display.class into the newly created folder.
    3) in my jsp page, add " import="tools.*"
    But it still doesn't work.
    Any ideas? T.I.A.

  • Import packageless classes in a jsp : tomcat 5.0.16

    Hi all,
    I am trying to import a class, say one.class, which is stored in the /WEB-INF/classes folder of the webapplication into a jsp page. Like,
    <%@page import="one"%>
    I get the following error,
    C:\jakarta-tomcat-5.0.16\work\Catalina\localhost\test\org\apache\jsp\testing_jsp.java:7: '.' expected
    import one;
    what could the problem be? I suppose, the problem is in accessing a class which is not inside a jar.
    take care,
    Siddharth.

    Hi,
    If you are using jdk 1.4 and above, you need to have package name for classes .
    You could just give a try after removing the import statement . Perhaps the server could find the classes in your WEB-INF/classes directory. I doubt though.
    -Amol

  • Import java classes in a JSP

    hallo
    I have craeted aPackage "TestPackage" as subdirectory in the order
    tomcat\webapps\ROOT\WEB-INF\classes\TestPackage
    in this package ther ist the class Test
    I try to imort this class in the jsp
    <%@ page language="java" import="TestPackage.*"%>
    <jsp:useBean id="app" scope="page" class="Test"/>
    <%
    for(int i=0; i< 10; i++){
    %>
    <h1><%= app.getName()%></h1>
    <%
    %>
    error:
    [javac] C:\tomcat4\work\Standalone\localhost\_\test_jsp.java:43: cannot resolve symbol
    [javac] symbol : class Test
    [javac] location: class org.apache.jsp.test_jsp
    [javac] Test app = null;
    who ist the Problem ???
    thanks

    Hi Orient,
    Actually <jsp:useBean /> takes fully qualified class name.
    so your code for <jsp:useBean /> should be like this
       <jsp:useBean id="app" scope="page" class="TestPackage.Test"/>
      For more details please refer http://java.sun.com/products/jsp/tags/11/syntaxref1115.html
    Regards
    Goodieguy

  • How do I Display a string from a servlet into a JSP Page???? NEED HELP!!!!

    Hi guys,
    How do I Display a string from a servlet into a JSP Page...
    Ive tried so many bloody things!.....
    Simply.
    I get text from JSP. The servlet does what ever it does to the string.
    Now. Ive create sessions and bean things,.... how the hell do I display it in a text box... I can display on the screen.. but not in the text box.!!!
    please help!!!

    hmmm, I dont really like using JSP programming, u should be using JAVA..
    the way to do it is:
    Call and cast to the bean like this:
    <%@ page import="beans.*" %>
    <% //cast to bean get request create object
    userNameBean u= (userNameBean) request.getSession().getAttribute("userNameBean");
    then... all you do is call it like this:
    <input type="text" name="firstName" value="<%= u != null? u.getFirstName(): "" %>">
    this is the real programmers way,,,
    chet.~

  • How include a Servlet into a JSP page?

    Hi!!
    I need make a combobox with a servlet and place its result into a jsp page.
    The servlet is in a package, but when i do: <jsp:include file="sic.view.servlet.ComboServlet" />
    tell me that "file attribute isn�t a valid attribute name"
    whow can i do to make the combobox whit the servlet and include this into the jsp page??
    Thanks!!
    PD: Sorry my pour English...

    Servlets should be mapped to a URL, then you access the servlet via that URL.
    The servlet mapping is done in the web.xml (in WEB-INF/ directory of your web application)
      <servlet>
        <servlet-name>
          Combo_S
        </servlet-name>
        <servlet-class>
          sic.view.servlet.ComboServlet
        </servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>
          Combo_S
        </servlet-name>
        <url-pattern>
          /combo
        </url-pattern>
      </servlet-mapping>Then you would use:
    <jsp:include file="combo" />
    to include it.
    Make sure the class file gets put in the right package under WEB-INF/classes/

  • Including JavaScript into a JSP Page

    Hi,
    How do i include a piece of JavaScript <SCRIPT> stuff into a JSP Page?
    Right now i have an HTML Page that includes some <SCRIPT> code. Now many other HTML files use this piece of <SCRIPT> stuff. How do i remove it , put it in one place(I mean where to put it and what would that file be called) and in a JSP page call this <SCRIPT> code?
    Please help . i'm pretty new to JSP and JavaScript.
    Thanks in Advance.
    Phani
    /**** CODE
    <SCRIPT language=javascript>
    <!--
         if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') == -1))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/1.css\">");
         else if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') > 1))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/5.css\">");
         else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') == -1))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/2.css\">");
         else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') > 1))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/3.css\">");
         else if (("Netscape" != navigator.appName) && ("Microsoft Internet Explorer" != navigator.appName))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/6.css\">");
    // -->
    </SCRIPT>

    Ok, first let us make clear the demarcation between java and javascript.
    Java runs on the server, and produces an HTML page which is sent to the client.
    That HTML page may contain javascript code on it to run on the client side.
    As the page is loaded, javascript may be compiled/run on the client.
    So you have some javascript code which you want to include on every page as template text?
    I would do this in JSP by using the include directive to add that bit of template text to every single JSP page.
    ie
    header.jspf
    <SCRIPT language=javascript>
    <!--
    if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') == -1))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/1.css\">");
    else if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') > 1))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/5.css\">");
    else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') == -1))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/2.css\">");
    else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') > 1))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/3.css\">");
    else if (("Netscape" != navigator.appName) && ("Microsoft Internet Explorer" != navigator.appName))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/6.css\">");
    // -->
    </SCRIPT>
    <noscript>
      // stuff here for when the browser does not support javascript
    </noscript>And then in every jsp page
    <%@ page include="header.jspf" %>
    // rest of the JSP pageThe file "header.jspf" will be included with every jsp page served, and you only need to update that page in one place.
    If you have a JSP2.0 container you can define a jsp prelude which will be the same as having the <%@ page include="header.jspf" %> on every page.
    You do this in the web.xml file:
    Something like this:
      <jsp-property-group>
         <url-pattern>*.jsp</url-pattern>
         <include-prelude>/WEB-INF/jspf/prelude1.jspf</include-prelude>
      </jsp-property-group>The specified file will be loaded into every JSP page without the JSP page having to define the import itself.
    Hope this helps,
    evnafets

  • Can I put a class into a jsp??

    I want to put this class into a jsp.. and reference it when I need it... can i just dumped it into a jsp... or do I have to do anything specific to it...
    public class areaformat {
         public synchronized static String replace(String str, char oldchar, String newstr)     {
              StringBuffer sb = new StringBuffer(str);
              int len = sb.length();
              try     {
                   for (int i=0; i<=len; i++)     {
                        if (sb.charAt(i) == oldchar)     {
                             sb = sb.replace(i, i, newstr);
                             sb.deleteCharAt(i + newstr.length());
                             i = i + newstr.length() - 1;
              }catch(StringIndexOutOfBoundsException sioobe)     {
                   if (len == 1 && str.equals("'")) {
                        sb = new StringBuffer(newstr);
              return sb.toString();
    Thx RIch

    No, you can't. You can put only the function in the beginning of your jsp file like:
    <%!
    public void myFunction(...){
    %>
    So, you can use myFunction wherever you want in the page.
    The other method is to compile your class in a file called "javac className.java" and the put the .class file generated in your WEB-INF/classes folder of your web-container.

  • How can i call java class file in jsp page

    Hai,
    i wants to call .class file in jsp page.
    my class file is in C:\jsdk\bin.
    Thanks

    I'm not entirely sure what you mean by "calling a class file", but I'm going to assume that you want to do something like the following in your page:
    <%
    MyClass myClass = new MyClass();
    myClass.someMethod();
    %>etc
    If that's the case, then all you have to do is make sure that the class is in the servlet engine's classpath. You'll probably also need to include an appropriate import statement at the top of the page.
    Hope that helps.

  • What's up when you drag and drop a table into a jsp page?

    Hi All,
    I was wondering what's happen in dragging and drop a table into a jsp page. This question because untill yesterday i had an application up and running, with a table displaying a number of rows of the database, and an action associated with an update into a database.
    The action is managed trough JNDI, defined from Preference-Embedded.......
    It was working.
    Then the machine hosting the db changed IP addres. I went into Webcenter Administration console, I've changed the connection string into the jdbc parameters, by updating the new IP address... but it's not working anymore! The log comes out with a big error, but basically it can't connect at the db!
    So, I think there is somewhere some reference to the old db.....where???
    Thanks
    Claudio

    Yes Shay,
    I got this error:
    JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.DMLException, msg=JBO-26061: Error while opening JDBC connection.
    in few hours I'll be able to give you the full stack.
    Thanks
    Clauido
    Message was edited by:
    user637862
    Hi Shay,
    Thanks a lot..you were right.
    I've located the ba4j on the webcenter server...and I've noticed that it was with the old address.
    I think it's a bug, cause on the local machine (before to deploy) this file comes with the right address.
    So next time, before to redeploy a new application, I think I'm going to fiscally delete the folder from j2ee folder.
    Thanks again for the help!
    Claudio

  • How to import Custom idoc into  IR?

    I have a custom idoc and i need to map it with the receiver format after importing into IR . Please let me know the sequence of steps to import custom idoc into  Integration repository?
    I think I need to first import into IDX2 and then import into repository. Am I correct?

    Hi Prateek,
    thanks for the information .The normal standard idocs we import by searching the idoc eg- for importing matmas we type mat and we search it, since it is a standard idoc it will be available in the list (after selecting the chek box "Import of idoc or rfc interfaces from sap system permitted").
    But my question is how we import custom idoc as they wont be present in the list?

Maybe you are looking for

  • Firewire port stays on??

    Sorry if this has been addressed - but my quick search revealed no answer. Recently upgraded from a G4 iMac (which I kept - love it) to a G5 2ghz machine. Noticed that when I shut down, my external firewire drive stays on. This didn't happen with the

  • Where are the iPhone backups stored?

    I am completely reformatting my aging iMac in order to clean the years worth of stale data... However, although the applications can all be re-installed, I need to be sure I save all my iTunes info. I have saved off all of the folders contained withi

  • Current status of Tiles and JSF integration

    Hi. I am new to JSF, and I have been researching Tiles integration with JSF. I've read a lot of posts about difficulties encountered when integrating them, and other posts seem to suggest that it is definitely do-able (some posts say using Shale Tile

  • Disable price showing in catalog

    Experts, We just configured the ECO module for ERP, and are having trouble preventing the price from showing in the catalog.  We have configured the catalog in WWM2 to not show prices, but they still display in the B2B application. Does anyone have s

  • Problems turning audio in clip completely down

    I am having problems turning the audio within some of my clips totally off. It is especially a problem when there are transitions between clips. The level is at the bottom - but when I play the movie sequence back I hear small bits of audio from with