Problem in calling JSP page from a servlet

can anyone please tell me how to call a JSP from servlet?
My code is:
ServletContext sc = this.getServletContext();
                                             RequestDispatcher rd = sc.getRequestDispatcher("./Welcome.jsp");
                                             if (rd !=null)
                                                  try
                                                       rd.forward(req, res);
                                                  catch (Exception e)
                                                       sc.log("---------------Problem invoking JSP.------------------", e);
I n the browser when i call this servlet it gives error-404.
NOT Found.
please help.

I would try to change "./Welcome.jsp" to "/Welcome.jsp". I'm not sure what that period will do.
Are you able to access that JSP directly from your browser (even if it's not designed to be accessed that way)? If not, then you have some other problem.
When you say you get a 404 when you access the servlet, is that when you access the servlet, or when it tries to forward to the JSP? If you get the 404 when you access the servlet, perhaps your servlet-mapping to the servlet is invalid.

Similar Messages

  • Can I call JSP page from forms6i C/S?

    Hi.
    How can I call JSP page from forms6i Client/Server?
    Flavio.

    What is your problem with a host command? You can use:
    host('c:\program files\internet explorer\iexplore.exe http://server/page.jsp');
    There a disadvantage indeed: you have to close the browser before you can return to the form.

  • Calling jsp page from plsql

    Please help me to the following
    How to Call jsp page from plsql??
    Please its urgent
    Edited by: 883730 on Mar 19, 2012 12:05 AM

    The best approach would be to change the behavior of your site so that it includes index.jsp as one of the default files. Typically that is done using the upper-level control files of the site. Here's a link from Sun that describes their approach.
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/WebApp4.html
    Actually, you don't say what type of webserver you're using, so it's really hard to guess. But if you were using an Apache webserver, you might want to review the "DirectoryIndex" directive here...
    http://httpd.apache.org/docs/2.2/mod/mod_dir.html
    In fact, if you were using Apache and didn't want to do that, you could do a redirect to another page using the "redirect" directive in the webserver control files as described here:
    http://httpd.apache.org/docs/2.1/en/mod/mod_alias.html#redirect

  • Calling jsp page from a java program

    Hello,
    Is it possible to call a JSP page from a java program? If so, please let me know how it is possible.
    I have a JSP page that inserts 10 records in a database based on the attribute given to the page. When the java program is executed all the 10 records need to be inserted.
    The JSP page is already running fine in Tomcat.
    Thanks and Regards,
    Prasanna.

    MVC has applied the standard of seperate your view , model and controller. I believe nobody will insert data from jsp page,better practice should be inserted from your database layer, normally is like DAO layer. so you should pass your data from jsp to your backend.
    hopefully it's help u

  • Calling JSP page from BSP

    Dear Guys,
    From  BSP application I want to call a JSP Page. Is itpossible?
    How can we integrate BSP and JSP....?
    Any configuration has to be done.....?
    Regards,
    Shamila

    if you have the url of it you can call from BSP.

  • How to call jsp page from OA page

    Hi all,
    I am new to OA Framework..I have a requirement where i have to navigate to a new jsp page.. on clicking a link in the OA page.The major trouble in this is that , that new jsp page should open in a new window.. not in the same window.
    Please give me some solution as it is very urgent for me.
    Thank you.
    Vasantha

    Similar issue has been discussed in last few weeks. Search in threads before posting the issues.
    --Shiv                                                                                                                                                                                                                   

  • How to call JSP page from applet?

    I have some page1.jsp from which I call applet.
    User works with this applet but some information does not in date inside applet.
    So user click on some component at applet (some button etc.) and now I would like to do this:
    1) open new window;
    2) call page2.jsp at this new window.
    The reason is that page2.jsp will read some data from database and then displays it in HTML inside page2.jsp itself. It is not necessary to pass these date back to applet for displaying them inside of applet.
    So user then can have 2 windows: page1.jsp with applet and page2.jsp with some details information.
    But I DO NOT know how to call page2.jsp from applet, and do ti in a new window. Is it possible and how?
    Thanks
    Mirek

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MainMenu extends JApplet implements ActionListener
         private JMenuBar mbar;
         private JMenu Master,Leave,Report,Logout;
         private JMenuItem UserMaster,DeptMaster,DesignationMaster,LeaveAvailable,LeaveApply,Generate;
         private JPanel jp;
         public void init()
              mbar=new JMenuBar();
              Master=new JMenu("Master");
              Leave=new JMenu("Leave");
         Report=new JMenu("Report");
              Logout=new JMenu("Logout");
              UserMaster=new JMenuItem("UserMaster");
              UserMaster.setMnemonic('U');
              DeptMaster=new JMenuItem("DeptMaster");
              DeptMaster.setMnemonic('D');
              DesignationMaster=new JMenuItem("DesignationMaster");
              DesignationMaster.setMnemonic('D');
              LeaveAvailable=new JMenuItem("LeaveAvailable");
              LeaveAvailable.setMnemonic('L');
              LeaveApply=new JMenuItem("LeaveApply");
              LeaveApply.setMnemonic('L');
              Generate=new JMenuItem("Generate");
              Generate.setMnemonic('G');
              Master.add(UserMaster);
              Master.add(DeptMaster);
              Master.add(DesignationMaster);
              mbar.add(Master);
              Leave.add(LeaveAvailable);
              Leave.add(LeaveApply);
              mbar.add(Leave);
              Report.add(Generate);
              mbar.add(Report);
              mbar.add(Logout);
              UserMaster.addActionListener(this);
              DeptMaster.addActionListener(this);
              DesignationMaster.addActionListener(this);
              LeaveAvailable.addActionListener(this);
              LeaveApply.addActionListener(this);
              Generate.addActionListener(this);
              Logout.addActionListener(this);
              mbar.setVisible(true);
              Container con=getContentPane();
              con.add(mbar,BorderLayout.NORTH);
         public void actionPerformed(ActionEvent ae){
              if(ae.getSource()==UserMaster)
              }

  • Problem in calling jsp/servlets ...Last Day

    when ever I call jsp page from browser, It always search the jsp page in the parent directory of the documentroot directory.
    Also I am not able to set the configuration for calling the servlet from my customize laocation. is any other entry needed except specifying the repositry path in zone.properties file.
    Please help...........I have not very time left for evaluation of 9ias 1.0.2.0.0
    If any one encountered this type of problem. pls respond immediately
    I have installed 9ias v10200 enterprise edition with oracle 8.1.6(enterprise edition) as origin database on winnt server 4.0 with service pack 5. At the time of installation I have selected oracle web cache , forms & reports to be configured at the time of installation.
    I am using port say 10000 other than default port 80, but on same IP.
    I have entered the folling entries at the end of httpd.conf file.
    <VirtualHost 192.168.1.120:10000>
    ServerName rnd1
    DocumentRoot e:/test
    DirectoryIndex hi.html
    </VirtualHost>
    Listen 80
    Listen 10000
    now when I request "http://rnd1:10000/ClamHome.jsp" from browser, It gives the messege that source file "ClamHome.jsp" not found on path "e:\" which is the parent of my documentroot path. Why it try to search at parent directory of document root????????
    another thing is that, when I run the demos of jsp given with 9ias v10200, they works(jsps) fine.
    but after running the demo which is on port 80 with documentroot e:\9\Apache\Apache\htdocs,
    I again call my ClamHome.jsp at rnd1:10000 then it gives error that file not found at "e:\9\Apache\Apache\htdocs". Strange behaviour, this time it searches on path which I called earlier.
    pls help
    null

    I would try to change "./Welcome.jsp" to "/Welcome.jsp". I'm not sure what that period will do.
    Are you able to access that JSP directly from your browser (even if it's not designed to be accessed that way)? If not, then you have some other problem.
    When you say you get a 404 when you access the servlet, is that when you access the servlet, or when it tries to forward to the JSP? If you get the 404 when you access the servlet, perhaps your servlet-mapping to the servlet is invalid.

  • How to call a jsp page from oaf and run in jDeveloper

    Hi all,
    I created sample jsp and then tried.
    String temp = "sample.jsp?";
    pageContext.setForwardURL(temp,
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);
    It worked.
    But when i tried with one of the custom page that i downloaded from server it is giving error.
    But now i need to call that page.
    Its Code is given on below link:
    Re: how to call a jsp page from oaf
    Please help me to do this.
    Thanks in advance.
    Regards,
    Raj

    Raj,
    1. Hope you have placed the custom jsp page (which you have downloaded from server) under "jdevhome\jdev\myhtml\OA_HTML" directory ?
    2. Try to run the custom jsp page from Jdeveloper directly and check whether its working properly or not ?
    (i.e. add jsp page to any project in Jdeveloper then right click on jsp page and select Run xxx.jsp)
    3. If page errors out then custom jsp page seems require few parameters to run it successfully. Pass all requied parameters and test.
    4. There is no problem in the way you are calling jsp page from OAF page.
    regards,
    Anand

  • Need to Call OA Page from Servlet

    Hi All,
    My requirement is to call OAF page from the servlet.
    Can anyone please give me some pointers to achieve this.
    Thanks
    Anoop

    hi
    anoop ,check if this thread can help u
    how to call a OA page from a jsp page
    thanx
    Pratap

  • How to get multiple selections from jsp page in my servlet

    Hello Everyone,
    I've a list that allows users to make multiple selections.
    <select name=location multiple="multiple">
        <option>
             All
        </option>
        <option>
             Hyd
        </option>
        <option>
             Dub
        </option>
        <option>
             Mtv
        </option>
      </select>I want to get the selections made by user in jsp page from my servlet, selections can be multiple too.
    ArrayList locList = new ArrayList();
    locList = request.getParameter("location");when I do so, I get compilation error as the request returns string type. How do I then get multiple selections made by the user.
    Please let me know.

    For those kind of basic questions it would help a lot if you just gently consult the javadocs and tutorials.
    HttpServletRequest API: [http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html]
    Java EE tutorial part II: [http://java.sun.com/javaee/5/docs/tutorial/doc/]
    Coreservlet tutorials: [http://courses.coreservlets.com/Course-Materials/]

  • Urgent....How can i redirect to my jsp page from servlet in init() method..

    How can i redirect to my jsp page from servlet in init() method..Becoz that servlet is calling while server startsup..so im writing some piece of code in init() method..after that i want to redirect to some jsp page ...is it possible?
    using RequestDispatcher..its not possible..becoz
    RequestDispatcher rd = sc.getRequestDispatcher("goto.jsp");
    rd.foward(req,res);
    Here the request and response are null objects..
    So mi question can frame as how can i get request/response in servlet's init method()..

    Hi guys
    did any one get a solution for this issue. calling a jsp in the startup of the servlet, i mean in the startup servlet. I do have a same req like i need to call a JSP which does some data reterival and calculations and i am putting the results in the cache. so in the jsp there in no output of HTML. when i use the URLConnection i am getting a error as below.
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:707)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:705)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:519)
    at com.toysrus.fns.alphablox.Startup.callJSP(Unknown Source)
    at com.toysrus.fns.alphablox.Startup.init(Unknown Source)
    at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
    so plz do let me know how to call a jsp in the start up of a servlet.
    Thanks
    Vidya

  • How to invoke a jsp page from java which does not use Servlets?

    Hello,
    I am working in Documentum. I am trying to invoke a jsp page from another java page which does not use Servlets.
    I tried doing this by just instantiating the java class related to the jsp page from my present java class.In my java class related to the jsp page, I have defined onInit() and onRender() methods.
    Now, I am trying to call the jsp page from my present java class by just instantiating the java class related to the jsp page. This throws a java.lang.NullPointerException.
    Any comments or suggestions on this.Any help would be appreciated.
    Thanks,
    Ranjith M.V

    RanjithM.V wrote:
    Hello,
    Thanks for the reply. One important thing I forgot to mention. I am also using xml component.And?
    As this is the standard way used for coding in Documentum, I do not want to use Beans.Well, JSP's should, in and of themselves, contain no functional code. It should all be only display.
    Without that is it not possible?What did I say? I said,
    masijade wrote:
    It is possible, but I very, very, very, much doubt, that it would be worth the effort.And, if you don't know how, a forum is not truely going to be able to help you implement it (at least not in less than a few years time, at which point it would be outdated).
    >
    Appreciate your understanding and help.
    Thanks,
    Ranjith M.V

  • How to call a JSP page from Applications menu?

    Hi partners,
    I am still looking for "how to call a JSP page from Applications menu?", I mean instead of calling a form, I want to call a JSP page which is staying in a OC4J repository which is located in another server.
    Any idea will be really appreciated.
    Thanks in advance.
    Frank Mtz.

    Hi Frank,
    if u know the solution please share it with me. i'm looking for the same scenario.
    thanks in advance,
    anish

  • How can I call an ".asp" from a Servlet?

    I want to make a call to an asp page from my servlet. If i use the conventional way of doing it as follows:
    RequestDispatcher rd = getServletContext().getRequestDispatcher("http://localhost:8080/abc.asp");
    rd.forward(request, response)
    It gives me IllegalArgumentException saying that the "Path must be absolute". And if i give the relative path like
    RequestDispatcher rd = getServletContext().getRequestDispatcher("/abc.asp");
    rd.forward(request, response)
    In this case it takes me to the asp page, but gives some ClassNotFoundException - images.
    I do not understand what class it is looking for and where to get that?
    So Why am i not able to call an ASP from Servlet, Any clue??

    What are you trying to accomplish? A redirect is one of the only ways to successfully go from a Servlet to an ASP. For example:response.sendRedirect("http://server:9090/abc.asp?name=value");This is mainly because when you forward, your actually sending the request and response objects under the current servlet context to be processed by another JSP/servlet in the same (sometimes cross) context.
    When interacting with ASP's your actually communicating between web containers (one which is Java based the other VB based).
    When you use:RequestDispatcher rd = getServletContext().getRequestDispatcher("http://localhost:8080/abc.asp");
    rd.forward(request, response) Your telling the servlet to send it's contents outside the web container where they cannot exist as such (even though you are pointing to your own JSP server, it's the "http://" that makes it assume your trying to get out).
    Using: RequestDispatcher rd = getServletContext().getRequestDispatcher("/abc.asp");
    rd.forward(request, response) is fine but what is processing your asp in your Java Web Server?
    The best way to mix JSP/Servlets with ASP (in my opinion others may debate it if they please) is using messaging like XML. Trying to share sessions between ASP and Java is quite messy and to much effort for a 1 to 1 communication option.
    Back to an earlier question, what is processing your asp files in the Java web server? If you have something processing them (like ChilliSoft) then check the docs to see if it supports session sharing between JSP/Servlet - ASP.
    Anthony

Maybe you are looking for

  • Can't add markers to SOME subclips but can add them to others

    Hi. First time poster, I hope I'm not accidentally posting this in the wrong section. I have scoured the discussions for this problem or I wouldn't dry your eyeballs with this. Suddenly, right in the middle of editing, I can no longer ADD markers to

  • Attaching a region or page to new tab

    hi All, we have added a new tab on sourcing page. i.e. we have already four tabs available: Requisitions, Negotiations, Intelligence and Administrator. now we have added new tab. but we are getting null pointer exception when click on new tab. can an

  • The first few frames of my FCP sequence are always garbled

    I have imported files shot on a JVC 700 shooting .MOV files, the files play fine everywhere. When I render the timeline the first 3 or 4 frames become pixelated.

  • MacBook air keeps freezing. help please!

    I have recently purchased a MacBook Air and every time I go to watch something on Skygo it keeps freezing. There's nothing I can do. No buttons work, I can't reset it and if I shut the screen down it remains still running. The only option i'm left wi

  • PSE9 Organizer is very slow

    The organizer is very slow and take over a minute just to page from one screen to another.  I took off facial recognition but that only helped minimally.  Is this an improvement?  Previously used PSE 6 which worked fine. This is test of the trail ver