How to call jsp /servlets running in different web application in tomcat

hello all,
i have 2 web applications(Charts and Reports) in the same tomcat,i want to call jsp/servlets running in the Reports webapp from Charts webapp.how do i achieve this.
thanx
ravi

You can also use getContext(String context) in the ServletContext class to get a request dispatcher.
Using the above example it would be :
// in a servlet in the charts webapp
ServletContext context = getServletContext();
ServletContext reportsContext = context.getContext("/reports");
RequestDispatcher dispatcher = reportsContext.getRequestDispatcher("/path")
dispatcher.forward(request, response);Just note, that depending on your server's configuration getContext(...) might return null.

Similar Messages

  • How to call a controller from a different BSP application?

    I have searched for the documentation, I have found literature that says it is possible but I am struggling with the syntax. I am in BSP 'MVC1' and upon a condition I would like to call the main controller of BSP 'MVC2'. What will be the syntax?
    Thanks
    Mani

    Hi,
    this might help:
    MVC call another controller with other (own) namespace
    grtz
    Koen

  • How to Setup a JSP to Run on Different Physical Location than OC4J Defaul

    I am trying to setup a development environment for jsp application development in Oracle 9ias Release 2 for a development group. I followed the steps outlined in NOTe:167960.1 using both EM Website (creating a OC4J and editing server.xml and defau*.xml files) and DCMCTL (Doc ID: 185635.1) utility. OC4J app is coming up only partially which does not work.
    Is this possible to "Setup a JSP to Run on Different Physical Location than OC4J Default Home" in Oracle 9ias Release 2 ?
    Appreciate insight
    Thanks
    Subu

    I was finally able to get it up and running... I commented out all the apple specific lines in smb.conf until I was able to successfully finish the driver copy process via the Windows driver wizard. The line in the /etc/smb.conf which was causing this weird problem was:
         vfs objects = notify_kqueue,darwinacl,darwin_streams
    I have no idea what this line is about. However after commenting it out the driver installation immediately started to work. I cross checked it by adding the line again and viola the problem was back - so it can be broken down to this line...
    As I've found some other comments to this line in the internet I guess I will go for the smb.conf changes described in this article:
    http://blog.djmnet.org/2009/02/09/macs-needing-unix-network-geekery/
    Cheers
    jogi4mac

  • How to call a servlet in new window without toolbar from OA page

    How to call a servlet in new window without toolbar from a OA page?Please provide sample code

    I have tried with the way suggested in Mukul's blog using javascript in Destination URI property.
    I tried to open a OA Page and from which forwarded it to a servlet..
    It is showing the error:
    Error Page
    Exception Details.
    oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist.
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1223)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1969)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
         at oa_html._OA._jspService(_OA.java:86)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175)
         at oa_html._OA._jspService(_OA.java:96)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist.
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getAppId(OAWebBeanFactoryImpl.java:5391)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:969)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
         at oa_html._OA._jspService(_OA.java:86)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175)
         at oa_html._OA._jspService(_OA.java:96)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist.
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getAppId(OAWebBeanFactoryImpl.java:5391)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:969)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
         at oa_html._OA._jspService(_OA.java:86)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175)
         at oa_html._OA._jspService(_OA.java:96)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)

  • How to store jsp session data of different user in util.hashmap

    how to store jsp session data of different user in java.util.hashmap
    and access the data of all user on the server side
    The same example is given in professional jsp but its not working.
    I can use getIds() of httpsessioncontext but it's depricated

    Hi
    I'm trying to make an example.
    With the following codes you can get the date from the session.
    request.getSession().getAttribute("sessionname")
    To store it in a hashmap you could do it like this ->
    Hashmap hm = new Hashmap();
    hm.put(Object key, request.getSession().getAttribute("sessionname"));
    I hope you understand it if not just write it!
    Cyrill

  • How to call a package from a different instance?

    Dear all:
    how to call a package from a different instance?
    for example:
    package A belongs to instance A1
    package B belongs to instance B1
    Now I want to call the package B in instance A1, how can I do ? my environment is oracle 10g
    Regards
    Terry

    Terry Chen wrote:
    Dear all:
    how to call a package from a different instance?
    for example:
    package A belongs to instance A1
    package B belongs to instance B1
    Now I want to call the package B in instance A1, how can I do ? my environment is oracle 10g
    First you have to create create dblink in A1 database as below
    CREATE DATABASE LINK INSA1
       CONNECT TO USER_NAME IDENTIFIED BY <pass>
       USING 'B!' Then you can execute exec pack_b@INSA1;

  • How to call a servlet  by  java standalone application

    //program related to calling a servlet by java standalone application and printing the response on console
    import java.io.*;
    import java.util.*;
    import java.lang.Object;
    import java.net.*;
    public class Program
         public static void main(String s[])
         System.out.println("Hello this programm defines about how to call a servlet with a java application ");
         try{
              URL servlet = new URL("http://localhost:8080/anchor/studentform.html");
              URLConnection conn=servlet.openConnection();
              conn.setDoOutput(true);
              InputStreamReader isr=new InputStreamReader(conn.getInputStream());
              BufferedReader br = new BufferedReader(isr);
              String str =br.readLine();
              System.out.println("Source code is" +str);          
         catch(IOException e)
         System.out.println("exception is" +e);
    i am able to read only one line of the form, please help me out to read the whole form (file)

    You are only reading one line? Why aren't you reading the data in a loop? E.g. a while loop. (Keep reading till readLine returns null)
    Kaj

  • How to share HttpSession between different web application ?

    I have two web application ( ie two different war files), I discovered that the jsp in the two war files are not able to share the HttpSession, may I know how to you share the HttpSession between two different web application ?

    From the api doc:
    "Session information is scoped only to the current web application (ServletContext), so information stored in one context will not be directly visible in another."
    You can not share a Session object between web apps. You can create your own sessions using a database, textfile or hashmap. Do a search on the O'Rielly web site for psuedo-sessions.

  • I can get safari to go back to old setting, can anyoner explain how to, i can go to a different web address or see the 3 colors the green ,yellow, or red buttons to click out, how do i reset, and i have went to viewfull screen nothing anyone?

    i can get safari to go back to old setting, can anyoner explain how to, i can go to a different web address or see the 3 colors the green ,yellow, or red buttons to click out, how do i reset, and i have went to viewfull screen nothing anyone?

    http/:www.apple.com/support/safari
    this is not mbp, safari, or lion community

  • Change how paramters are chosen when running crystal on web i

    Hi there..
    i have the following problem.
    when i double click on a crystal report, in our QAS server, i get the following screen to chose parameters.
    https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/385923_10150579230068428_516188427_10979481_1660085047_n.jpg
    and when i click on the same report on the prudction server, i get it this way.
    https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/395199_10150539385573428_516188427_10793487_1411181440_n.jpg
    Where do i change it??
    both servers are the same version.. everything is the same.. just the way they are chosen that deffers..
    i want to change the production server to  be just like the QAS..
    Thanks in advance..

    Hi,
    Perhaps by changing your infoview Viewer preferences?
    or check out 1575886 - No SAP Prompt Screen in InfoView when viewing a rport based off multiple SAP data source 
    it says:
    Resolution
    To display the SAP prompt screen in InfoView for reports that are based off different SAP data source, enable the option: SAP.style.prompt.enabled, in the web.xml file of the web application. To enable the option:
    On your BusinessObjects Enterprise XI 3.1 server, go to the following folder:
    C:\Program Files\Business Objects\Tomcat55\webapps\PartnerPlatformService\WEB-INF
    Note: The beginning of the path may be different if you have chosen to install the product on a different drive or folder.
    Make a backup copy of the file: web.xml
    Edit the file: web.xml and add the following code:
       <context-param>
            <param-name>SAP.style.prompt.enabled</param-name>
            <param-value>true</param-value>
        </context-param>
    Note: You may already have the above code in the web.xml file. If it is present, it is by default commented out by being surrounded by the tags <!--  -->  If it's the case, then you simply have to remove the tags that comment out the code.
    Save the change.
    Restart the web application server ( Tomcat by default )
    Regards,
    H

  • Sharing object across 2 different web application

    Hello,
         I do not know if this is a right place to ask this kind of question...
         I have two different web applications running on 2 different tomcat servers.
         One of them creates one object ( say myComplexClassObject) which is serializable..
         and I want to share this object in another web applications.
         Both the apps are developed using JSP and servlets.
         Is there any way, I can make this object available in another application ?
         As the request object can not be used across 2 different contexts, I can not set it as attribute on request.
         I tried serializing myComplexClassObject in some test.dat. Problem going by this way is that
         how do I send this file to another application ?
         What I did is as follows....
         In the first app , I created the object and serialized it in one file test.dat. In the same app I read
         test.dat and send the content as query parameter to a JSP in another app. That JSP collects all the query parameters
         and constructs a big string out of it and then writes it to a file, test2.dat and tries to deserialize this.
         File sizes come out to be same. But it gives me StreamCorruptedException.
         Any idea, where I am doing wrong ? or any other way to share this object or to send the file to another app?
         I can not use FTP for some reasons. Size of the test.dat file is more than 10 KB.

    Some possible solutions:
    Use a webservice calls to pass the object,
    Use JAXB to convert the object to XML, pass the XMLover HTTP or a socket and use JAXB to convert the XML back into an object.
    Store the object as a blob in a database.
    Store the object in a Java aware database that can handle Java objects.
    Store the data in the object in a database.
    I am curious as to what information ot functionality is contained in this object that you feel the need to pass it between two servers.

  • How to install a war file as a Web Application Bundle (WAB) in CQ 5.5?

    How to install a war file as a Web Application Bundle (WAB) using CQSE and embedded OSGi Felix container? OSGi R4.2 specification specified Web application bundles which allows deploying war files as WABs insie OSGi containers. How do we do this in Felix container embedded in CQ 5.5?

    i m sorry, i intentionally wanted to post it in EJB forum, mistakenly i posted it in Servlets forum, anyways, if anyone of u know the ans, plz share it with me too.
    Thanx
    Nisha

  • How to disable u201Csticky sessionu201D for the particular web application?

    Hi All,
    Is there a possibility to disable so called u201Csticky sessionu201D for the particular web application? We have deployed a WAR file with the Axis 1.4 based web service into SAP NW 7.1. The web service works fine but when the client makes SOAP request the server creates a so-called u201Cstickyu201D HTTP session with the default (30 minutes) timeout. Such u201Csessionsu201D are created on each SOAP request from the same client. The maximum number for Java Web Sessions (SAP Management Console) is 1000. After a while the clients start getting the u201C503 Service not availableu201D errors:
    503 Service not available.
    Error: -6
    Version: 7010
    Component: ICM Java
    Date/Time: Tue Mar 03 14:30:12 2009 
    Module: http_j2ee2.c
    Line: 1166
    Server: XXXXXXXXXXX
    Error Tag:
    Detail: server overload: no more sessions available
    The only way to improve the situation we found so far was to set session timeout to 1 minute. That u201Csticky sessionu201D will still be created, though.
    This is a testing environment and we do not use any hardware/software loadbalancer. 
    Any help/advice is appreciated. (Please let me know if you need more information.)
    Thanks,
    Dmitry Vasilenko

    The practical workaround we finally come up with for this problem was to create a servlet filter and map it to the AxisServlet. The servlet filter will invalidate the HTTP session and effectively destroy the sticky session created by the server on each SOAP request.
    Here is the fragment from the web.xml
    <filter>
      <filter-name>StickySessionFilter</filter-name>
      <filter-class>com.xxxxx.xxxxx.xxxx.services.StickySessionFilter</filter-class>
    </filter>
    <filter-mapping>
      <filter-name> StickySessionFilter </filter-name>
      <servlet-name>AxisServlet</servlet-name>
    </filter-mapping>
    <servlet>
      <servlet-name>AxisServlet</servlet-name>
      <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
    </servlet>
    The doFilter() method looks like this:
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
           try {
                  chain.doFilter(request, response);
           } finally {
                         javax.servlet.http.HttpServletRequest httpRequest = (javax.servlet.http.HttpServletRequest)request;
                         javax.servlet.http.HttpSession session = httpRequest.getSession();
                         session.invalidate();
    Thanks,
    Dmitry Vasilenko

  • How to get the ablolute path of the web application in WebSphere?

    How to get the ablolute path of the web application in WebSphere?
    For example:
    I have installed IBM WebSphere on D:\WebSphere\Appserver, and I created a new appliction named "myapp" on D:\myapp,. How can I get the absolute path of application "myapp"? In other words,how can I get the absolute path of the application's
    root directory?

    In the WebSphere(default), what directory is the Java Bean's root directory ?

  • How to find out Db name of perticular web application in sharepoint 2010

    how to find out Db name of perticular web application in sharepoint 2010 to take a backup from sql

    1.  Open the SharePoint 2010 Central Admin application.
    2.  On the SharePoint central administration website, click Application Management.
    3.  In the Databases section, click Manage Content Databases.
    4.  On the Manage Content Databases page, select a web application by clicking the Web Applications drop-down list and choosing a web application.
    5.  Can notice the  available database names for the webapplication. ******************************************************************************************
    Please remember to mark your question as answered &Vote helpful, if this solves/helps your problem
    s p kumar

Maybe you are looking for

  • TS1363 My HTC One no longer connects to Itunes whereas it did previously - any suggestions?

    I have previously been able to sync HTC One with iTunes, but it now doesn't appear in the devices list.  Any ideas why this is so?

  • Need to output # of rows after date

    This seems like it probably has a simple solution that I just can't seem to get correct... I need to output the next 4 events that take place from the current date. I tried: <cfloop from="1" to="4" index="i"> <cfif #DateFormat(games.gamedate)# GTE #D

  • Alv result send to External email adreess

    hi, i want to send Alv grid result send to External email adreess.n e body help me how can i do this

  • PLD - How to link Items and Items Group

    Hi guys, I'm having a problem that seems simple, but I can't solve it. My sales order layout was working fine, showing items and grouping by items group. Then all of a sudden, it started not to show anything in the repetitive area. When I was studyin

  • HELP! 3G USB Adapter

    I am a current Verizon customer with a basic calling plan with pay as you go data plan (non-3g phone). I will be traveling soon and I want to add a 3g USB adapter to my netbook. Can I add the service to my plan on a temporary basis? Or as a pay as yo