Invoking getParent() from JSP tags

Hi,
I am writing a JSP tag that may only be invoke within a specific enclosing tag and I would like to invoke getParent() to get a reference to my enclosing tag but I can't seem to find out how to do this under JSP tag files. Any ideas?
Gili

one way is to set the parent tag as an attribute on the pageContext when ur processing the parent tag.
example:
suppose there is a parent tag and child tag nested in it......
ParentTag.java
public ParentTag() {
   public int doStartTag() throws JspException {
     // set the parent as a page attribute - for the nested child tag ...
     pageContext.setAttribute("someKey", this);
    return EVAL_BODY_BUFFERED;
ChildOfParentTag.java
public ChildOfParentTag() {
  public int doEndTag() throws JspException {
        // Get the parent tag from the page context that was set previously         
    ParentTag parent = (ParentTag) pageContext.getAttribute("someKey");
}reg,
sien..

Similar Messages

  • How to invoke bpel from jsp

    Hi,
    I created a bpel application helloword.bpel which has one assign activity it takes input as a name i want to invoke this from jsp i write a code in jsp as follows:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="com.oracle.bpel.client.Locator" %>
    <%@ page import="com.oracle.bpel.client.NormalizedMessage" %>
    <%@ page import="com.oracle.bpel.client.dispatch.IDeliveryService" %>
    <%@ page import="com.oracle.bpel.client.util.Parameters" %>
    <html>
    <head>
    <title>helloworld</title>
    </head>
    <%
    String name=request.getParameter("name");
    if(name==null)
    name="BPEL";
    String xml ="<name xmlns=\"http://xmlns.oracle.com/helloworld\">" + name + "</name>";
    Locator locator = new Locator("default","helloworld");
    com.oracle.bpel.client.dispatch.IDeliveryService deliveryService = (com.oracle.bpel.client.dispatch.IDeliveryService) locator.lookupService(com.oracle.bpel.client.dispatch.IDeliveryService.SERVICE_NAME);
    com.oracle.bpel.client.NormalizedMessage nm = new com.oracle.bpel.client.NormalizedMessage();
    nm.addPart("payload",xml);
    deliveryService.post("helloworld","intiate",nm);
    out.println("BPELprocess helloWorld intiated");
    %>
    </html>
    i compiled this it is error free but when i try to run this i got a 500 internal server error whats the problem i dont if any one knows pls help me out.
    im new to bpel.
    the error is
    500 Internal Server Error
    java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.rmi.RMIServerContext.lookup(RMIServerContext.java:207)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.ApplicationContext.unprivileged_lookup(ApplicationContext.java:255)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.ApplicationContext.lookup(ApplicationContext.java:195)     at javax.naming.InitialContext.lookup(InitialContext.java:351)     at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279)     at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)     at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:174)     at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:149)     at _helloworld._jspService(_helloworld.java:63)     [helloworld.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.1.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)".     at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:82)     at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:254)     at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:174)     at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:149)     at helloworld.jspService(_helloworld.java:63)     [helloworld.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.1.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)Caused by: java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.rmi.RMIServerContext.lookup(RMIServerContext.java:207)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.ApplicationContext.unprivileged_lookup(ApplicationContext.java:255)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.ApplicationContext.lookup(ApplicationContext.java:195)     at javax.naming.InitialContext.lookup(InitialContext.java:351)     at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279)     at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)     at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:174)     at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:149)     at _helloworld._jspService(_helloworld.java:63)     [helloworld.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.1.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)".     at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:293)     at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)     ... 21 more

    Looks like you are hitting some bug on 10.1.3.1.0, have you tried on a higher version and also referred SOA_ORACLE_HOME\bpel\samples\tutorials\102.InvokingProcesses\jsp sample ?

  • Assiginment to varaibles from jsp tags

    is it possible and how is it possible to assign something from jsp tag to an variable declared in scriptlet code - ie. - as below.
    also is there a good resource for jsp info - a comprehensive lookup on jsp syntax egs on the web that any one is aware of. - thanks.
    i 'm doing - can i use this variable as in below scrpitlet code :
    <%! List myAbridgments = new ArrayList(); %>
    then - Also at this stage it get a ClassCastException - why would i get that here i dont use this variable - results anywhere else - except in setting the session attribute in the original servlet that calls this jsp page
    <jsp:useBean id="results" class="com.bt.ros.Results" scope="session">
    <jsp:setProperty name="results" property="*"/>
    </jsp:useBean>
    the in some scrpitlet code doing:
    <%  myAbridgments = results.getAbridgments();
    for (int i = 0; i < myAbridgments.size(); i++) {
                    abridgment = (Abridgment) myAbridgments.get(i);
                        //out.println(abridgment.geta_volume_id());
    %>
    <p><input type="checkbox" name="list" value="ON"><span style="font-size:12pt"><jsp:getProperty name="abridgment" property="a_sub_year_volume"/></span><span style="font-size:12pt">,
         <a href="abridgment_link.htm"><jsp:getProperty name="abridgment" property="a_volume_id"/></a>, </span>

    yeah, but this doesn't really help me. I am trying (really hard!) to ensure my JSP's don't really contain any "code" as such, just JSP tags.
    The end result I want is to include one JSP in another. Now, I "could" just use a <jsp:include.., the problem is that the path to the file I want to include is tied up in an object which I have previously placed in the ServletRequest object. Again, I "could" extract this in the "parent" jsp, and pass it dynamically to the jsp:include, but I don't want any actual Java "code" in the JSP. (There IS a good reason for this, so I can't really comprimise).
    The fact that the IS a pageContext.include() method tells me that I can use it. I must be doing something wrong though.
    Thanks anyway.

  • Invoking webflow from JSP

    Does anyone know if there is a method for programmatically invoking a webflow from
    a jsp? I have a jsp that has multiple "modes", for instance, it posts to itself
    and will do one of 3 things "action1", "action2", or "action3".
    I want the jsp to mimic a redirect and go to the page associated with action1,
    2 or 3.
    i saw the method invokePortletWebflow in PortalAppflowHelper but am not sure what
    it really does.
    thanks

    Hello,
    You should use the webflow JSP tag library to create webflow URLs that
    will forward the request to. Look at the <webflow:createWebflowURL> tag.
    If you want to do a redirect instead of a forward to the destination JSP,
    then set doRedirect="true".
    What you would do is set event="mystuff.action1" and you would create a
    webflow, using the EBCC, that links the "mystuff.action1" event from your
    origin JSP to your action1 JSP page. Similarly for action2, action3.
    If you are doing this in the context of a portlet that is in a portal,
    then you should look at the <portlet:createWebflowURL> tag. Because the
    portlet webflow is executed within the overall portal webflow, you must use
    this tag to set the portletId and a few other things. You would create a
    separate portlet webflow that would be very similar to the webflow I
    describe above.
    See the webflow taglib docs at
    http://edocs.bea.com/wlp/docs70/jsp/navigat.htm#998197
    See the portlet taglib docs at
    http://edocs.bea.com/wlp/docs70/jsp/mngprtal.htm#1001597
    I would also recommend the "Setting Up Portal Navigation" doc at
    http://edocs.bea.com/wlp/docs70/dev/navigate.htm
    Let me know if you have any trouble creating your webflow and using the
    createWebflowURL tag.
    "B Hogan" <[email protected]> wrote in message
    news:[email protected]..
    >
    Does anyone know if there is a method for programmatically invoking awebflow from
    a jsp? I have a jsp that has multiple "modes", for instance, it posts toitself
    and will do one of 3 things "action1", "action2", or "action3".
    I want the jsp to mimic a redirect and go to the page associated withaction1,
    2 or 3.
    i saw the method invokePortletWebflow in PortalAppflowHelper but am notsure what
    it really does.
    thanks

  • Urgent-how to access custom tag from jsp tag

    I have a problem accessing a custom tag from a jsp expression.
    Details: I have a custom tag that returns a string variable. I need to access that variable from jsp expression <%%>.
    Can any body help me?

    Tags don't "return" values as in the normal sense.
    They can only support TEI (Tag Extra Information) that just stuffs a declared variable into the page's state.
    For example, if the tag class had a public method called getValue(), you could do the following:
    <xmp:mytag id="foo"/>
    <%
    out.println("value is " + foo.getValue());
    %>

  • Invoking Forms from JSP and Vice versa

    Hi,
    I am in to a requirement like invoking a screen developed using Oracle Forms 6i from JSP and vice versa.
    1. Could you please anybody help to get the documents to be refered to get more idea on this?
    2. Is it possible only by Oracle ADF?
    Please help me on this.
    Thanks & Regards
    M Thiyagarajan

    Hi All,
    Thanks a lot for the clarifications.
    Actually, integration should happen between forms and JSP. Parameters need to be passed to and forth. I will go through the specified link.
    Also could you please clarify me where exactly, ADF comes into picture? or what are all the advantages when we go for ADF?
    Thanks & Regards
    M Thiyagarajan

  • Calling PL/SQL stored procedure from JSP tag

    Hello,
    I need to call a PL/SQL procedure from a JSP tag , I donot want to use any Bean to call the PL/SQL procedure. How would I call PL/SQL stored procedure from within JSP using JSP tag library, need some code.
    Thank you
    Syed

    need to call a PL/SQL procedure from a JSP tag , I donot want to use any Bean to call the PL/SQL procedure. How would I call PL/SQL stored procedure from within JSP using JSP tag library, need some code.
    regards
    Indira Rani Bandi

  • Invoking Forms from JSP

    Where can I find full documentation on invoking a Form from within a jsp page.
    Tks
    Booker Northington II

    im, using uixml. within my uix page i am using the <servletInclude> tag. I have a OracleForm I am trying to display within my uix contents. I pass in the desired url, nothing shows. I was looking for some documentation which dose this to ensure I have not missed something in the process.
    Tks.
    Booker Northington II

  • Error in invoking servlet from JSP

    Hi - again!
    after being thoroughly reprimanded for posting on the wrong board, and hence seeing the error in my ways, all help greatly appreciated....
    I have read elsewhere that it is possible to call a servlet (which produces HTML) from within a JSP, thus keeping a nice clean MVC paradigm and making it easier for non-java people to design the front-end.
    I am having difficulty getting it to work and any help is much appreciated:
    My servlet (Mole):
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                out.write("###some html stored in DB#####");
            } finally {
                out.close();
        }my JSP:
    <jsp:include page="Mole" flush="false"></jsp:include>the error I get
    Internal error flushing the buffer in release()
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.io.IOException: Stream closed
            at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:257)
            at org.apache.jasper.runtime.JspWriterImpl.clearBuffer(JspWriterImpl.java:206)
            at org.apache.jsp.CMS.services_jsp._jspService(services_jsp.java from :176)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
            at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
            at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
            at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
            at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)Any pointer as to what I am donig wrong?
    many thanks

    in your web.xml
    <servlet>
    <servlet-name>Mole</servlet-name>
    <servlet-class>srvlt.Mole</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Mole</servlet-name>
    <url-pattern>/Mole</url-pattern>
    </servlet-mapping>
    package srvlt;
    // Import servlet packages
    import javax.servlet.*;
    import javax.servlet.http.*;
    // Import other Java packages
    import java.io.*;
    public class Mole extends HttpServlet {
            public void init() throws ServletException {}
            public void doGet(HttpServletRequest request, HttpServletResponse response)
                    throws ServletException, IOException {
                response.setContentType("text/html;charset=UTF-8");
                PrintWriter out = response.getWriter();
                try {
                    out.write("###some html stored in DB#####");
                } finally {
                    out.close();
    }in your jsp
    <jsp:include page="/Mole" flush="false"></jsp:include>

  • Cannot invoke servlet from JSP

    I am trying to invoke a servlet from my JSP file. At present I am getting the error:
    500 Internal Server Error
    java.lang.IllegalArgumentException: Resource /servlet/CreateSPSS not found
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.EvermindPageContext.forward
    I understand that my JSP cannot find my servlet but I cannot identify what the correct path or amendment is.
    My JSP file is located in:
    default-web-app/examples/jsp/com.xml2spss.jsp
    In the JSP my forward parameter is :
    <jsp:forward page="/servlet/CreateSPSS" />
    and my servlet (.java & .class) is located in
    default-web-app/WEB-INF/classes/com/pmstation/spss/site/servlet.CreateSPSS.java
    I have added the following line to Web.XML:
    <servlet-mapping>
    <servlet-name>CreateSPSS</servlet-name>
    <url-pattern>/servlet/CreateSPSS</url-pattern>
    </servlet-mapping>
    Where am I going wrong??
    Thankyou for any help at all on this one.

    Shaun,
    Nice to know that you find a way that works. However, what Zsolt suggests should work; otherwise, it is a bug. That is, put the servlet definition and servlet mapping in your web.xml and then you should be able to access http://host:port/myWebContext/servlet/CreateSPSS?myParmName=myParm without seeing a response like "No resource found". Please make sure that your servlet definition come before the corresponding servlet mapping.

  • Invoking XSQL from JSP

    Hi!
    I want to invoke XSQL page from a JSP script using <jsp:include> which is possible due to Oracle documentation. However when I run my very simple test script I get an error message saying:
    javax.servlet.ServletException: Include /test.xsql failed: can only include a JSP or HTML page.
    JSP itself works fine, so does XSQL/XSL! Have I missed anything in configuration somewhere? What could possibly be wrong? Any help will be welcome!
    Thanks
    Piotr

    Hi,
    Well, the latest version pre-release of oc4j on OTN works fine. You can use Java XDK is 9.0.1.2.0.
    Actually, there are some basic setup for XSQL framework that needs to be done before you can get it going. You can find these in the XDK documentation and also in the OTN code samples I mentioned earlier.
    In any case, just check if you have the following.
    (oc4j_home is where your oc4j is installed for eg: d:\oc4j on windows)
    These are under oc4j_home\j2ee\home\lib directory
    1) oraclexsql.jar, the XSQL page processor
    2) xmlparserv2.jar, the Oracle XML Parser for Java v2
    3) xsu12.jar, the Oracle XML SQL utility
    4) classes12.jar, the Oracle JDBC driver
    2) XSQLConfig.xml
    Edit the xml file above and add entries to the datasource from which you fetch data.
    similar to below:
    <connectiondefs>
    <connection name="scott">
    <username>scott</username>
    <password>tiger</password>
    <dburl>jdbc:oracle:thin:@<localhost>:<port>:<SID></dburl>
    <driver>oracle.jdbc.driver.OracleDriver</driver>
    <autocommit>true</autocommit>
    </connection>
    </connectiondefs>
    use correct values for localhost, port and sid.
    3) make sure you have the below entries in global-web-application.xml in config directory of oc4j
    <servlet>
    <servlet-name>xsql</servlet-name>
    <servlet-class>oracle.xml.xsql.XSQLServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>xsql</servlet-name>
    <url-pattern>/*.xsql</url-pattern>
    </servlet-mapping>
    For example:
    Your jsp can be like below:
    <%@ page contentType="text/html;charset=WINDOWS-1252"%>
    <%@ page language="java" %>
    <HTML>
    <HEAD>
    <TITLE> Invoking XSQL page using jsp:include </TITLE>
    </HEAD>
    <BODY>
    <FORM NAME="Main" METHOD="post">
    <TABLE BORDER=0 WIDTH=800 align="center">
    <TR VALIGN=TOP>
    <TD WIDTH="24%" ALIGN=CENTER>
    <jsp:include page="getEmp.xsql" flush="true" />
    </TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>
    Corresponding xsql file would be:
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="getEmp.xsl"?>
    <xsql:query xmlns:xsql="urn:oracle-xsql" connection="scott">
    SELECT empno, ename FROM emp ORDER BY ename
    </xsql:query>
    Corresponding xsl file would be:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" indent="yes"/>
    <xsl:template match="/">
    <TABLE>
    <TR>
    <TD>
    <FONT COLOR="#CC0000" SIZE="+1">
    <B>List of Emp names from table Emp</B>
    </FONT>
    </TD>
    </TR>
    </TABLE><BR></BR>
    <TABLE border="1">
    <xsl:for-each select="/ROWSET/ROW">
    <TR>
    <TD width="50%"><xsl:value-of select="EMPNO"/></TD>
    <TD width="50%"><xsl:value-of select="ENAME"/></TD>
    </TR>
    </xsl:for-each>
    </TABLE>
    </xsl:template>
    </xsl:stylesheet>
    Hope this helps.
    Thank you.
    Savitha.

  • Passing params to custom tag from jsp

    Hi all, I have a problem passing params back to my custom tag. The tag handler has a "getPageNumber()" method which returns a value. Initially the value is set and if a link is clicked it passes that param to the tag handler. I am trying to get this value from the tag handler to update the value on the link parameter.
    Something like this:
    // processed tag
    <a href="mypage.jsp?page=1">Next page</a>
    // clicking "Next Page"
    <a href="mypage.jsp?page=2">Next page</a>
    // jsp
    <taglib:tag param="<%=getPageNumber()%>"  />
    // in tag lib
    private pagenumber=1;
                pagenumber++;
    getPageNumber(){
    return pagenumber;
    setPageNumber(int pagenumber){
       this.pagenumber=pagenumber
    }I'm not sure if this is the best way to do this or if what I am trying to do is even possible.
    Any advice would be greatly appreciated.
    Thanks :)

    Hi all, I have a problem passing params back to my custom tag. The tag handler has a "getPageNumber()" method which returns a value. Initially the value is set and if a link is clicked it passes that param to the tag handler. I am trying to get this value from the tag handler to update the value on the link parameter.
    Something like this:
    // processed tag
    <a href="mypage.jsp?page=1">Next page</a>
    // clicking "Next Page"
    <a href="mypage.jsp?page=2">Next page</a>
    // jsp
    <taglib:tag param="<%=getPageNumber()%>"  />
    // in tag lib
    private pagenumber=1;
                pagenumber++;
    getPageNumber(){
    return pagenumber;
    setPageNumber(int pagenumber){
       this.pagenumber=pagenumber
    }I'm not sure if this is the best way to do this or if what I am trying to do is even possible.
    Any advice would be greatly appreciated.
    Thanks :)

  • Invoking operations from a jsp correlation error

    Hi, I’m a student in Informatics at the University of Turin (Italy).
    On December I’m graduating and so I’m finishing my stage about web services and BPEL, that actually is the object of my thesis.
    To realize my stage I’ve used the Oracle BPEL Process Manager and I’ve created an asynchronous process whose port types are the following.
    <!-- portType implemented by the NewYorkPrenotazione BPEL process -->
    <portType name="NewYorkPrenotazione">
    <operation name="initiate">
    <input message="tns:NewYorkPrenotazioneRequestMessage"/>
    </operation>
    <operation name="complete">
    <input message="tns:DatiUtenteMessage"/>
    </operation>
    </portType>
    <!-- portType implemented by the requester of NewYorkPrenotazione BPEL process for asynchronous callback purposes -->
    <portType name="NewYorkPrenotazioneCallback">
    <operation name="onResult">
    <input message="tns:NewYorkPrenotazioneResponseMessage"/>
    </operation>
    </portType>
    My problem is very simple. If I invoke my process from the BPEL console and then complete it with the “complete” operation (always from the console), everything goes right and the process completes successfully.
    Instead, if I want to invoke and complete my process by jsps it doesn’t work because of correlation problems. To invoke it from my jsp I use the instruction
    deliveryService.post("NewYorkPrenotazione", "initiate", nm);
    and that’s ok, but after that I can’t invoke the second operation, “complete”, from another jsp using the same signature, because the server can’t find the right instance of my process since I’m indicating only the processId while it needs the instance id.
    The top of the stack is the following.
    500 Internal Server Error
    java.rmi.RemoteException: Correlation definition not registered.
    The correlation set definition for operation "complete", process "NewYorkPrenotazione", has not been registered with the process domain.
    Please try to redeploy your process to the process domain.
         at com.oracle.bpel.client.dispatch.BaseDispatcherService.continuePostAnyType(BaseDispatcherService.java:727)
         at com.oracle.bpel.client.dispatch.BaseDispatcherService.continuePost(BaseDispatcherService.java:646)
         at com.oracle.bpel.client.dispatch.BaseDispatcherService.post(BaseDispatcherService.java:238)
         at com.oracle.bpel.client.dispatch.DispatcherService.post(DispatcherService.java:66)
         at com.oracle.bpel.client.dispatch.DeliveryService.post(DeliveryService.java:173)
         at com.oracle.bpel.client.dispatch.DeliveryService.post(DeliveryService.java:132)
         at concludiNYPreno.jspService(_concludiNYPreno.java:91)
         [SRC:/concludiNYPreno.jsp:56]
         at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:347)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
    etc..
    How can I resolve my correlation problem?
    If I can find the solution I could finish my stage and this would be great for me.
    If I haven’t been clear enough just tell me.
    Thanks in advance.
    Jessica

    Sorry, but I think there are problems with copy and paste, 'cause I can see that in my preview.
    well, this is my first jsp which invokes the first operation.
    <%@page import="com.oracle.bpel.client.Locator" %>
    <%@page import="com.oracle.bpel.client.NormalizedMessage" %>
    <%@page import="com.oracle.bpel.client.dispatch.IDeliveryService" %>
    <html> .....
    <body>
    <%
    // Estrazione dei campi della form
    String dataPartenza = request.getParameter("dataPartenza");
    String dataRitorno = request.getParameter("dataRitorno");
    String nroPersone = request.getParameter("nroPersone");
    String cameraSingola = request.getParameter("cameraSingola");
         String cameraDoppia = request.getParameter("cameraDoppia");
         String cameraMatrimoniale = request.getParameter("cameraMatrimoniale");
         String tipologia = request.getParameter("tipologia");
         String aereoporto = request.getParameter("aereoporto");
         String compagnia = request.getParameter("compagnia");
         String assicurazione = request.getParameter("assicurazione");
         String noleggioAuto = request.getParameter("noleggioAuto");
         String statuaLiberta = request.getParameter("statuaLiberta");
         String manhattan = request.getParameter("manhattan");
         String musei = request.getParameter("musei");
         // Creazione del documeto XML da inviare al processo BPEL
         String xml = "<NewYorkPrenotazioneRequest xmlns=\"http://tutorial.oracle.com\">"
              + "<dettagliViaggio>"
              + "<dataPartenza>" + dataPartenza + "</dataPartenza>"
              + "<dataRitorno>" + dataRitorno + "</dataRitorno>"
              + "<nroPersone>" + nroPersone + "</nroPersone>"      
              + "</dettagliViaggio>"
              + "<dettagliHotel>"..........................
              + "</dettagliHotel>"
              + "<dettagliVolo>"................
              + "</dettagliVolo>"
              + "<dettagliGite>"........
         + "</dettagliGite>"          
              + "<prezzoTotale/>"          
              + "</NewYorkPrenotazioneRequest>";
         // Connessione al server BPEL Oracle
         Locator locator = new Locator("default","bpel");
         IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
    // Creazione di un messaggio normalizzato e invio all'Oracle BPEL Process Manager
         NormalizedMessage nm = new NormalizedMessage();
         nm.addPart("payload", xml);
         // Inizializzazione del processo NewYorkPrenotazione
         deliveryService.post("NewYorkPrenotazione", "initiate", nm);
    %>
    </body>
    </html>
    and then this is my second jsp that should invoke the operation complete but.. instead, gives the 500 error
    <%@page import="com.oracle.bpel.client.Locator" %>
    <%@page import="com.oracle.bpel.client.NormalizedMessage" %>
    <%@page import="com.oracle.bpel.client.dispatch.IDeliveryService" %>
    <html>..........
    <body>
    <%
         // Estrazione dei campi della form
         String nome = request.getParameter("nome");
         String cognome = request.getParameter("cognome");
         String via = request.getParameter("via");
         String numero = request.getParameter("numero");
         String citta = request.getParameter("citta");
         String provincia = request.getParameter("provincia");
         String cap = request.getParameter("cap");
         String stato = request.getParameter("stato");
         String numeroCC = request.getParameter("numeroCC");
         String scadenza = request.getParameter("scadenza");
         // Creazione del documeto XML da inviare al processo BPEL
         String xml = "<DatiUtente xmlns=\"http://tutorial.oracle.com\">"
              + "<cognome>" + cognome + "</cognome>"
              + "<nome>" + nome + "</nome>"
              + "<indirizzo>"................
              + "</indirizzo>"
              + "<cartaCredito>"
              + "<numero xmlns=\"http://definizioni.com\">" + numeroCC + "</numero>"
              + "<scadenza xmlns=\"http://definizioni.com\">" + scadenza + "</scadenza>"
              + "</cartaCredito>"
              + "</DatiUtente>";
         // Connessione al server BPEL Oracle
         Locator locator = new Locator("default","bpel");
         IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
         // Creazione di un messaggio normalizzato e invio all'Oracle BPEL Process Manager
         NormalizedMessage nm = new NormalizedMessage();
         nm.addPart("payload", xml);
         // Invocazione dell'operazione complete del processo NewYorkPrenotazione
         deliveryService.post("NewYorkPrenotazione", "complete", nm);
    %>
    </body>
    </html>
    Now that you can see my code, have I to add the instructions you wrote?
    Thank you very much for your help!
    Jessica

  • Calling JSP Tag Files from Coldfusion

    I am trying to call a JSP Tag file from Coldfusion. I am
    getting "Unknown Tag" error.
    Here is the code I have.
    <CFIMPORT TAGLIB="/WEB-INF/lib/mtgTags.jar"
    PREFIX="mtg">
    <mtg:chooseDate appId="1" />
    mtgTags.jar contains a chooseDate.tag file.
    I know CFIMPORT statement above is working fine. Can anyone
    please tell why am I getting "Unknown Tag: chooseDate" error.
    Thanks

    Hi,
    You get the custom tag output into a hidden variable (say 'key') and use the request.getParameter("key")
    Hope u got the answer...
    Regards
    ravi

  • Invoking PL/SQL procedure from JSP

    Hi
    Is there any solution, to invoke a PL/SQL procedure from JSP?

    my example: PL/SQL procedure named: getsidforwinuser and the following in a JSP file
    <%
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@hostname:port:SID", "User", "Password");
    CallableStatement FindID = conn.prepareCall("{ ? = call getsidforwinuser ( ? )}");
    FindID.registerOutParameter (1, Types.INTEGER);
    FindID.setString (2, DomainIntern.trim()+"\\"+Username);
    UserID = ((OracleCallableStatement)FindID).getInt(1);
    conn.close();
    catch(SQLException e)
    throw new RuntimeException("SQL Exception " + e.getMessage());
    %>
    <h1>User ID is:<%= UserID %></h1>

Maybe you are looking for

  • Z1 SD card issues..Often caused by FAKE SD cards, unbeknownst to the user and those trying to help?

    Hi All... Well for the last month or so Ive had problems with my 64 gb SD card..losing data, getting corrupt and requiring non stop formatting..until eventually it just died totally. Of course, throughout all this I was searching various forums for f

  • F110 critical issues

    HI We  had a problem in  current  payment run and all details attached below for your reference . step by step my problem.... 1)     On 30th-Apr-2010 ,  Business run the payment run for 44 vendors 2)  One posting order created out of 44 vendors u2026

  • Link from another website

    I want to use the iWeb blog software, but I have a website that does not use iWeb. Can I link the iWeb blog from my website? Thanks!

  • Addition of Node based on some criteria

    Hi Experts, My scenario is to add the details of one table of a tab1 to another table of tab2. I need to add the details of a Msg_Id of status "High" of the table of tab1 to the table of tab2. I need to check the condition and then add.. Can any one

  • How to separate my adornments from effects applied to page item?

    Hi All, I have my own graphical page item. And I also draw special border and, the most important, my special label if my object is bigger than its frame. (Text frame behaviour is the example for me). I tried to draw adornments in MyShape::DrawPageIt