Forwarding from servlet in web app...

          I'm having a problem forwarding to a page within a web application. Basically if I do:
          getServletContext().getRequestDispatcher("/login.htm").forward(request,response);
          then the page isn't found as the forward doesn't put the web application context into the URL. I can work round this by using:
          request.getContextPath()
          and then building up the path with the web application in it.
          This becomes a real pain too with static HTML pages. If the pages have links in them which are absolute, again the web application context is not prefixed.
          Am I missing something here? I was under the impression that the deployment of web applications was supposed to be transparant to the components within them.
          Any help would be appreciated. I'm running on WLS 6 on W2K.
          Cheers,
          Andy
          

Andy,
          I'm haivng the same problem! I'm working with getting Jive (the open-source
          discussion board product) to work with WLS. This software is full of
          response.sendRedirect calls that are relative. These all fail with WLS 6.
          Jeff Mathers
          "Andy Winskill" <[email protected]> wrote in message
          news:[email protected]...
          >
          > I should follow the flow of my servlet better.....
          >
          > The main problem is with request.sendRedirect not working with a relative
          URL. Forwarding to an absolute URL in a web app works fine. However,
          absolute links in a HTML page are absolute with respect to the server and
          not the web application.
          >
          > Cheers,
          > Andy
          >
          > "Andy Winskill" <[email protected]> wrote:
          > >
          > >I'm having a problem forwarding to a page within a web application.
          Basically if I do:
          > >
          >
          >getServletContext().getRequestDispatcher("/login.htm").forward(request,resp
          onse);
          > >
          > >then the page isn't found as the forward doesn't put the web application
          context into the URL. I can work round this by using:
          > >
          > >request.getContextPath()
          > >
          > >and then building up the path with the web application in it.
          > >
          > >This becomes a real pain too with static HTML pages. If the pages have
          links in them which are absolute, again the web application context is not
          prefixed.
          > >
          > >Am I missing something here? I was under the impression that the
          deployment of web applications was supposed to be transparant to the
          components within them.
          > >
          > >Any help would be appreciated. I'm running on WLS 6 on W2K.
          > >
          > >Cheers,
          > >Andy
          >
          

Similar Messages

  • OC4J shuts down servlet in web-app A during deployment of web-app B ?!

    Hey all,
    We have a web-app A deployed to OAS 10g that contains a servlet with <load-on-startup> set to 2.
    This servlet loads fine when the app is deployed.
    However, when we deploy web-app B to our server, we notice in the logs that the destroy() method on the above servlet is invoked in web-app A! After web-app B is finished deploying, the init() method on the above servlet in web-app A is fired again.
    What's going on?
    Thanks.

    I have posted this on the JDeveloper forum and been pointed in the direction of this discussion as it seems I am experiencing the same problem.....
    I currently have an instance of the OC4J 10.1.2 standalone (current production version) server running, and am deploying 5 servlets to the same server. Once they are all deployed they all run fine without any problems at all.
    However, if I need/want to make an update to one of these 5 servlets and then redploy it the server, the server effectively restarts terminating any open sessions that users may have on any of the other four servlets as well (i.e. users are forced to login again to the particular servlet they are using).
    Is this a bug in the OC4J 10.1.2 standalone (current production version) server? or have I not set something in the deployment profile for each of these servlets/applications to prevent this from happening?
    All advice/suggestions would be gratefully appreciated as soon as possible.
    Thanks in advance
    David

  • How do I show/refresh data from an Access Web App in an Excel spreadsheet saved in a Document Library on Sharepoint 2013 online

    I have an Access 2013 Web App in my Sharepoint 2013 online website. It contains a query to report on its data (several, actually, but let's keep it simple). I want to connect an Excel spreadsheet to the query, visualise the data in pivot tables/graphs/whatever,
    save the spreadsheet in a Document Library, and let other team site Sharepoint users open the spreadsheet (preferably in Excel online, but with Excel client if it has to be) and see/copy the data, refreshed with the latest information from the Access Web App.
    Simple, surely!
    The way I'm doing it at the moment is to create an ODC file to connect to the cloud-based Access 2013 database, save that ODC in a Data Connection Library in the SP site, and use the saved ODC file as data source in the Excel spreadsheet. This works and
    successfully keeps everything 'in the cloud' but I can't get it to refresh in Excel Online, and if I open the spreadsheet in Excel Client I have to enter the database password every time to refresh it. I don't really want to issue this password to everyone
    who might want to view the data. There must be a better way than this ODC method, I suspect.
    Googlings on this have led down various blind alleys - Excel Services, PowerPivots, Web Parts - but I'm stuck on which to follow through. Please, someone, point me to an article/book/website that explains how to do this step-by-step in simple language..
    thanks
    Jonathan

    I don't see any quick way of achieving it - at least there's no such functionality exists in SharePoint. All you can do, develop an event receiver that will update the fields in the list item once the excel file is added/updated. You can use OpenXml API
    to manipulate the excel file.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • I upgraded to Firefox 8.0.1 on may MacBook OSX 10.6.8 and not all files I download from my Outlook Web app are ashx file, not what they were originally sent in. How do I change this ?

    I have just upgraded to Firefox 8.0.1 on may MacBook (10.6.8) and now all files I download from my Outlook Web app labeled attachment.ashx, not as they were originally sent (.docx, .pdf, etc). How do I change this back?

    I'm going to back up to Firefox 7 next. I'm getting the drift that 8.0.1 and/or flash on 8.0.1 are unstable.
    I'll let you know if that solves this problem.
    NOPE. This had no effect.

  • Auto log in from applet to web app.

    I'm trying to allow a user to jump from an applet to a web app.
    The applet code I'm pretty sure is complete. It creates a URL and then calls container().getAppletContext().showDocument(new URL(path),name);
    This opens a browser and seems to be sending the correct URL.
    What I have done is send it to a URL like /appName/JumpFromApplet
    Then I have created a filter in the web app to catch anything of that format.
    The doFilter method is being executed and it the if statement is catching it appropriately.
    But when the browser opens up the url is just http://localhost:9080/ with a page cannot be found. I'm not sure what I'm doing wrong. Here is the appropriate code. Am I way off base?
    private static final String LOGGEDIN_URL = "login.do";
    //inside doFilter method
    Object o = httpRequest.getSession().getAttribute("LOGGEDIN");
    if(o == null && url != null
             && url.indexOf(JUMP) > 0) {
         config.getServletContext().getRequestDispatcher(LOGGEDIN_URL).forward(request, response);
    }else {
         chain.doFilter(request, response);
    }edit:
    This is basically the same code as in my LoginFilter, I just changed the URL and of course the if statement.
    Edited by: gmachamer on Jan 22, 2008 9:05 AM

    hmmm, strange. I added the code to the loginFilter as an else if.
    If I enter the url in the browser that the filter is suppose to be catching then it works just fine.
    If I jump from the applet it does not... but when stepping through the code in both instances it looks like everything is the same?
    the else if is what is executed.
    public void doFilter(ServletRequest request, ServletResponse response,
            FilterChain chain) throws IOException, ServletException {
        HttpServletRequest httpRequest = (HttpServletRequest) request;
        Object o = httpRequest.getSession().getAttribute("LOGGEDIN");
        String url = httpRequest.getRequestURL().toString();
        if (o != null
                || (url != null && (url.indexOf(LOGIN_URL) > 0
                        || url.indexOf(LOGIN_FORM_URL) > 0
                        || url.indexOf(EXTERNAL_LOGIN_URL) > 0
                        || url.indexOf(EXTERNAL_LOGIN_FORM_URL) > 0
                        || url.indexOf("images") > 0 || url.indexOf(services) > 0))) {
            chain.doFilter(request, response);
            return;
        }else if(o == null && url != null
                  && url.indexOf(JUMP) > 0) {
              config.getServletContext().getRequestDispatcher("/" + JUMP_URL).forward(request, response);
            return;
        config.getServletContext().getRequestDispatcher("/" + LOGIN_FORM_URL)
                .forward(request, response);
    }Edited by: gmachamer on Jan 22, 2008 9:43 AM

  • Including output in a JSP page from a separate Web App

              I seem to be having a bit of a problem including the output from a sevlet invoked
              from a separate
              Web Application in the same domain. I have a servlet callsed 'WebApp2\Web-inf\classes\packagename\targetServlet'.
              I am attempting to invoke 'targetServlet' from 'WebApp1\somepage.jsp' using the
              jsp:include directive but I seem
              to be having a path problem because the servlet is not invoked. Anyone have any
              suggestions?
              

              Mark:
              You cannot do that with <jsp:include>. You can read the JSP spec to learn more
              about it.
              Anyway, there are some tags out there that do allow what you need. I, for one,
              use Struts' <bean:include> tag. See http://jakarta.apache.org/struts/
              The new JSTL (JSP Standard Tag Library - http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html)
              provides the <c:import> tag.
              Greetings
              "Mark Andersen" <[email protected]> wrote:
              >
              >I seem to be having a bit of a problem including the output from a sevlet
              >invoked
              >from a separate
              >Web Application in the same domain. I have a servlet callsed 'WebApp2\Web-inf\classes\packagename\targetServlet'.
              >I am attempting to invoke 'targetServlet' from 'WebApp1\somepage.jsp'
              >using the
              >jsp:include directive but I seem
              >to be having a path problem because the servlet is not invoked. Anyone
              >have any
              >suggestions?
              

  • Updating a SharePoint Calendar and sending email notifications based on information from an Access Web App

    Hi MSDN Forum,
    I have created an Access Web App that I am hoping to add some functionality to. I am looking to provide email notification to different users from my organization (a field within the Access Table) when the current date approaches the renewal date (another
    field within the Access Table). I would also like to display all renewal dates on a SharePoint Calendar for users to see. Any advice on how to do this would be much appreciated.
    Thanks!

    I'm not familiar with how Access Web Apps work. However, on the SharePoint side of things, it looks like a workflow will be your best bet. Are you using Visual Studio? I've created a few tutorials on sending email notifications in Visual Studio 2012. https://youtu.be/JFdiQEyDkEk

  • Add a link from image in web app

    I need to add a link to social media site in a static image in a web app detail layout.
    I have thought this would be...
    <a href="{tag_facebook}"><img alt="" src="/_assets/css/images/social-facebook.png" /></a>
    but this displays the link bedside the icon.
    I have tried field type "Text string (Hyperlink)" and "Text string (String)".
    any help appreciated.
    thanks megan

    Hey Liam,
    Franchise list of stores added to a web app abd each store can have a different link added to the icon.
    The icon is hard coded into the layout
    The url needs to change for each
    e.g. 15 Stores, some have their own Facebook page, some will link to a central Facebook page.
    So the icon is static in the web app detail layout, but url changes.
    When I add the code
    <a href="{tag_facebook}"><img alt="" src="/_assets/css/images/social-facebook.png" />
    the result in browser looks like...
    thanks Liam

  • Cannot open file in Onenote client from within OneNote Web App

    I am facing a peculiar problem with One note.
    Environment: - SP2013 Enterprise with separate Office Web Apps server
    I can view/edit onenote files on OneNote web app without any issue but when I click "Open in OneNote" button, I get the error that "onenote cannot open the specified location..."
    Other office documents like word and excel work fine, only onenote has this issue.
    Any help is much appreciated

    Thank you for the update.
    We may try to use the Network Monitor tool to capture the network traffic for bothe problematic site and working site when reproducing this issue, and then read the traffic to find out the differences between them. To capture the traffic, start capturing
    first, then click the “Open in OneNote” button.
    Download Microsoft Network Monitor tool:
    http://www.microsoft.com/en-us/download/details.aspx?id=4865
    If you cannot find the differences, you can send the capture files to us via
    [email protected]
    and we will analyse them for you.
    Regards,
    Steve Fan
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • How to refer to JNDI PROVIDER_URL from within Tomcat Web app

    Can anyone provide a clear description on how to refer to a "Provider_URL" relative to the web application root for which a Java Class resides within? My issue is as follows. I've looked through the JNDI tutorial and the Tomcat JNDI How-To's and I'm still unable to find a solution.
    I'll elaborate:
    I have a "PROVIDER_URL" class variable defined as:
    private String PROVIDER_URL = "file:/C:/development/MyProject/MyWebApplication/WEB-INF/properties";I initialize my JNDI context within the class:
    Properties properties = new Properties();
    properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
    properties.setProperty(Context.PROVIDER_URL, PROVIDER_URL);
    context = new InitialContext(properties);
    cpds = (ConnectionPoolDataSource) context.lookup(baseName);
    ...The above example works fine. My question is given my web app's directory, how do I refer to "MyWebApplication/WEB-INF/properties" in a relative manner so that if I move my web application to a different server, the directory path does not affect my deployment and I dont have to hardcode the current path? Does this need to occur in the "server.xml" file? Can you provide a URL to an example?
    Your suggestions are appreciated...thanks.

    try to give
    http://localhost:8080
    or the app server based port address.

  • Q: Forwarding from servlets within webapp

    Suppose I have a servlet mapping so that /guarded/* is mapped to servlet
              s1. If from within s1 I obtain a request dispatcher for
              "/guarded/page1.html" and call forward() (or include()) on it, I get
              into an infinite loop because that request is mapped back into s1.
              Any thoughts on how to escape this kind of loop?
              

    It sounds like what you want is a chance to interrupt the processing, not
              handle it completely yourself.
              One possibility is to forward to another path (/noaccess/page1.html) when
              someone requests something from your servlet-handled path
              (/guarded/page1.html).
              Cameron Purdy, LiveWater
              "Eugene Gross" <[email protected]> wrote in message
              news:[email protected]..
              > Suppose I have a servlet mapping so that /guarded/* is mapped to servlet
              > s1. If from within s1 I obtain a request dispatcher for
              > "/guarded/page1.html" and call forward() (or include()) on it, I get
              > into an infinite loop because that request is mapped back into s1.
              >
              > Any thoughts on how to escape this kind of loop?
              >
              >
              

  • Why PHP is better than JSP,Servlet(Java Web Apps) ?

    Well, my heart says JSP, Servlets are better but rent a coder and job market, demand-supply seems to be saying a different story... ? Why we should not learn PHP then ?

    dcminter wrote:
    You can develop web sites in PHP in two shakes of a lambs tail. But they aren't maintainable as they would be in .NET or J2EE and again the performance (which dicates what you can do as well as scalability) is between a scripted language with buggy runtime and a compiled language with an optimized runtime so you tell me. Yes, but rather like Spinoza's argument for the existence of God, an application that has existence is more perfect than one which exists only in the conception. Even if the conceptual one is faster.
    I don't denigrate languages like PHP that help novices get stuff done.
    To address the OP's complaint: If one language was objectively "best" then we would only need one language. In practice they all have strengths. The more you learn the more you'll know which to use for the task at hand. That said, to learn any language (even PHP) in profound depth will take the best part of ten years and maybe longer. Sometimes expediency leads us to use the language we understand better to solve a problem for which it is not ideally suited.Eloquent - well said.
    Bonus points for that Spinoza reference.
    %

  • Javascript not working after forward from servlet

    Hi,
    I have a jsp page which uses a html and a javascript file to generate a javascript calendar for date entry. The html doc is in the same directory as the jsp page and the javascript is in another directory.
    The calendar works fine when the jsp loads first.
    On submitting the form, the page calls a servlet which does some processing and then forwards to the same jsp using a requestdispatcher. Now the calendar script doesnt work anymore. How to solve this prob.
    Thanx.
    gopal

    Most likely the browser is looking for the javascript files in the wrong location. When you do a requestdispatcher the browser is not aware of it and it continues to keep the url of the servlet in the browser. If the JSP calls any images, javascript files or other resources using a relative path then the browser looks for these items rleative to the path that it has in the address bar.
    You can solve this by using absolute paths for all resources (ie start with a "/") or you can use the HTML BASE tag in the JSP which the browser will use to resolve paths instead of the url in the address bar.

  • 404 file not found ,for servlets in a web app but not for html files

              Hi everybody ,I have this web app on weblogic 7 .The application
              works file with Tomcat 4.0 but on WebLogic server 7,I am getting
              404 not found for all the servlets ,although weblogic is serving
              the html files without any problems
              

    Create a subdirectory called 'classes' and copy your servlet class file
              to the 'classes' dir.
              mydomain/applications/
              DefaultWebApp/
              WEB-INF/classes.
              Modify the web.xml file located in the mydomain/applications/
              DefaultWebApp/
              WEB-INF/ directory
              <web-app>
              <servlet>
              <servlet-name>
              myServlet
              </servlet-name>
              <servlet-class>
              package.name.myServlet
              </servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>
              myServlet
              </servlet-name>
              <url-pattern>
              servlet-url-pattern
              </url-pattern>
              </servlet-mapping>
              </web-app>
              Start the default WebLogic Server.
              Call your servlet from a Web browser with the following URL:
              http://localhost:port/servlet-url-pattern
              servlet-url-pattern is the value of the <url-pattern> element that you
              defined in the web.xml file.
              prakash wrote:
              > Hi everybody ,I have this web app on weblogic 7 .The application
              > works file with Tomcat 4.0 but on WebLogic server 7,I am getting
              > 404 not found for all the servlets ,although weblogic is serving
              > the html files without any problems
              

  • How to create new instance of the process from external web apps?

    Hi Everyone,
    How to create a new instance of the process which deploy to the weblogic server from the external web app?
    Thank you.

    Assuming the process includes a message start event, the simplest way is to use Web Service call. Once you've deployed the process you can use Enterprise Manager to get the URL of the WSDL. There's and icon at the top of the composite summary page for getting the WSDL, or you can get it from the test page. Use that WSDL URL to construct the client to use from the web app. If it's an ADF client you can generate either an ADF Data Control or a client proxy.

Maybe you are looking for

  • In Mail, clicking on a date does not properly create an iCal event

    If I click on a time/date in an email, a miniature calendar pops up showing the event as best as Mail can parse it. There are also two buttons: Edit and Add to iCal. If I click on Edit, I get a chance to change some of the parameters of the event, an

  • HTTPS and MMHttp in Dreamweaver CS3 for Mac

    MMHttp doesn't seem capable of HTTPS communication in Dreamweaver CS3 for Mac. When I do something like MMHttp.getText("https://americanexpress.com"); the resulting response has no data and a status code of 0. With MMHttp.getText(" http://americanexp

  • HT201210 help........my iphone not starting after i restore  it

    i have an iphone 3g and when i put it to the pc itunes it said that i have to restore it then an error ocure and the phone won't start again help me please as quick as possible

  • Where is the Sqlite .dll library ?

    Greetings In older versions of Firefox, the sqlite library where loaded from mozsqlite3.dll In the new versions, the file mozsqlite3.dll doesn't exist anymore. Where is the Sqlite library loaded from now ? Which file ? Thanks

  • HP Laptop brand new 99 windows 8 updates won't download

     I am helping a lady I work with with her HP Laptop.  She forgot her password so I have her laptop and I restored the system. Windows 8 has 99 updates that will not download.  At least I do not think they are downloading, the bar just moves for 5 min