Separate jsp/servlets from EJBs for petstore

By default, petstore deploy all the web apps and EJBs in one ear. I am trying to
separate the JSP/servlets to deploy to diffent machine. I need to modify the client
InitialContext to point to the remote server. I took a look at the source and
there are many places using the default constructor of InitialContext to load
the default URL. I wrote a jndi.properties file that has the correct url and put
this to the classpath. I know this file needs to be put to the working directory,
too. In case of pet store web application, what should be the working directory?
Thanks, Cathy

I'm also interested in running the Pet Store application server and the database
(Oracle prefered) on different systems.
Is this configurable during runtime or does it require code modification, compilation
and deployment?
Thanks,
TL

Similar Messages

  • Calling Servlets from EJB

    Please can anyone help me out of how to make sevlet calls from EJB? Example source code if available will be of great help too.
    I know that this is a rare senario but this is required for a very urgent work.

    Vladimir - thanks again !!
    I am getting closer, I have 3 errors for "cannot resolve symbol"
    .../work/jsp_testmap1175186470750.java:78: cannot resolve symbol
    symbol  : class mappingservices
    location: package appsrv
    fsd.oms.appsrv.mappingservices mappingServicesLocal = null;
                          ^
    .../work/jsp_testmap1175186470750.java:79: cannot resolve symbol
    symbol  : class mappingservices
    location: package appsrv
    mappingServicesLocal = (fsd.oms.appsrv.mappingservices)pageContext.getAttribute("mappingServicesLocal", PageContext.SESSION_SCOPE);
                                                               ^
    .../work/jsp_testmap1175186470750.java:85: cannot resolve symbol
    symbol  : class mappingservices
    location: package appsrv
    mappingServicesLocal = (fsd.oms.appsrv.mappingservices) Beans.instantiate(getClass().getClassLoader(), "fsd.oms.appsrv.mappingservices");
                                                               ^
    3 errors
    (all ^ point between appsrv and mappingservices)
    This appears to be a classpath issue? Could this fall under this SAP note?
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_jas/~form/handler
    Or do you know of issues with string methods instead of object methods?
    Those were a couple of posts I found, that seemed similar, but not really. I appreciate the experienced help and your thoughts!
    thanks again - Allen

  • Question? calling a servlet from EJB.

    Can anyone tell me how I would go about calling a servlet
    from a session bean that’s running in the same J2EE application.
    Application server is Oracle10g.
    Thanks.

    Welcome to the forum
    You seem to be misunderstanding something. Do some googling to learn what you need about servlets. Simplified, servlets are java code that's hosted by a web container, such as Tomcat. When a servlet gets called as a consequence of someone requesting a url from the container, it takes in a request object and a response object. All the magic is then in creating an appropriate response (e.g. html) for the incoming request.

  • Forwarding request from JSP/Servlet to EJB

    Is it possible to forward the HttpRequest,HttpResponse objects from a Servlet/JSP to an Entity/Session bean ?
    ie To forward the call using RequestDispatcher/forward to a Session bean which in turn calls the entiy bean for updating DB
    Ramesh

    I don't think that's possible and even if it is there's an easier way. Normally you just create an instance of the session bean in a servlet and pass it the information. The session bean then calls the entity bean which updates the database. You don't have to forward the request - just pass the data to the bean.

  • Servlets or EJB for Persistent external socket connections

    We have a Servlet that establishes a socket connection to another
    external server and sends and receives messages. We have the Servlet defined as pre-loaded when JRun starts.
    When JRun is started, the Servlet is started and connection is
    established with the external server. The problem is when a new message is being sent, the Servlet is instantiate again and the connection is stopped and restarted. We do a forward request from another Servlet to this.
    Am I totally misunderstanding Servlets because reading articles
    and books seems to indicate that I should create an EJB instead of a
    Servlet if you want a persistent connection.
    Thanks in advance for your help.

    I assume then that your connection to the external server is achieved in the "init" method of your servlet. Therefore every time the servlet container is called upon to accesss your servlet, it instantiates it - thus a new connection will be being made each time.
    I would take out the connection properties from the init method. I.e. you only want it to happen once.
    T

  • How can I call EJB from JSP/Servlets in iWS?

    Hi!!
    My JSP/Servlets are on iWS, and I deploy EJB on iAS.
    In this case, I don't know how JSP/Servlet call EJb on iAS.
    I'd like to know how I can set JNDI name in JSP/Servlet on iWS.
    I will thank you if you give me a simple example source using JSP/Servlet
    and EJB.
    Thanks in advance!!!
    - Park-

    Park,
    Why Are you running your JSP/Servlets in iWS instead of iAS? For whatever
    reason,
    look at the Converter sample from iAS. You will be doing RMI/IIOP in this
    case and the sample explains in detail what to do.
    hth,
    -robert
    "SungHyun, Park" <[email protected]> wrote in message
    news:9jpfmt$[email protected]..
    Hi!!
    My JSP/Servlets are on iWS, and I deploy EJB on iAS.
    In this case, I don't know how JSP/Servlet call EJb on iAS.
    I'd like to know how I can set JNDI name in JSP/Servlet on iWS.
    I will thank you if you give me a simple example source using JSP/Servlet
    and EJB.
    Thanks in advance!!!
    - Park-

  • Java, JSP, Servlet....!!!!????Can you help me?

    Hi all,
    Now I want to use Java (JSP, Bean, Servlet and EJB) for programming (application/web/internet/database). Which architects I should use?
    JSP --> Database.
    JSP --> Beans --> Database.
    Servlet --> Database.
    JSP & Servlet --> Database
    JSP & EJB --> Database...
    Can I use COM/DCOM such as ASP pages?
    And which databases (SQL Server, Oracle, Access, DB...) I should use? Which web servers (Jrun, JWS, Apache, JWS, Orion...)?
    Are there some stuff on Internet relate to this topic (some samples)?
    Thanks so much.

    Hi all,
    Now I want to use Java (JSP, Bean, Servlet and EJB)
    for programming (application/web/internet/database).
    Which architects I should use?you can use the Model-View-Controller or MVC model.
    Model = JavaBeans --> for your business logic/process
    View = JSP --> for your presentation like HTML
    Controller = Servlet --> as your router or dispatcher of the JSPs.
    And which databases (SQL Server, Oracle, Access,
    DB...) I should use? for large business applications that would require security, optimization, etc., i suggest that you go for a good dbase and i'm referring to Oracle, SQL Server, Sybase, Informix, and the likes. But, if you're going to do simple application, MS Access can do the job. Since it comes with MS Office installation, you'll not find it any harder to configure your dbase.
    Which web servers (Jrun, JWS, Apache, JWS, Orion...)?you can use the following apache, IIS, Websphere, etc...
    don't forget that you also need an application server. say, tomcat application server and apache web server.

  • Jsp,servlet,bean question,please help

    The Tomcat Web server set up like this.......
    The directory structure is
    e:/sampleapp/WEB-INF/classes
    /lib
    And the web.xml is in the WEB-INF for the use of ay potential servlet.
    The basic understanding is that all the .java files go into the WEB-INF directory and the .class files go into the classes directory.
    All the .jsp files go into the sampleapp directory.Till here is correct I feel.
    Now for my qustion......
    I plan to use jsp,servlet and beans for a potential web application...,where do all these files go?,just the same as above or is there a difference.
    Hope that I have given a reasonable explaination to my question.
    Thanks for any replies
    AS

    All of your compiled servlet and java bean (java
    classes in general) will be placed into the following
    directory (under a directory structure matching the
    java package they are in):
    e:/sampleapp/WEB-INF/classesAll of your .jar files that are used as libraries (not
    your .jar files for applets):
    e:/sampleapp/WEB-INF/libAll of the rest of your JSP files, javascript files,
    HTML files, JAR files, images files, etc. will go into
    the following directory:
    e:/sampleappYou must make sure you put your sampleapp directory
    where tomcat can load it. Or use the admin tool to
    load it. If you make a .WAR file with a corresponding
    web.xml file in it, it will simplify loading it into
    tomcat. It also will help you do your servlet
    mappings, etc. I hope this helps.Thanks for your timely response.To add to it,let me tell you.
    The <b>bean</b> files are put into a package right,so they should be put into the WEB-INF/classes/<package name>
    What about The <b> servlet </b> files...... they are just put into the WEB-INF/classes/ directory????
    Kindly let me know.
    Thanks
    AS

  • Question about domain name/JSP, servlets

    I have a web host which publishes my pages, say www.zzz.com. I want to use JSP/Servlets on my machine which is using Apache Tomcat. Here's the problem, if I link a JSP/Servlet from www.zzz.com, the user will see my IP, i.e. 37.28.18.102/servlets/Calculations
    Is there a way where the people's browser's URL text field will always be www.zzz.com even if the page is located on my server?

    Try using Frameset where top frame is always www.xxx.com and child frame can be anywhere

  • Sample jsp servlet bean (MVC) code

    We want to look into the JSP/Servlet/Bean area for our next project. We wish to understand the technology and as such want to hand build simple applications, and as such do not want to use JDeveloper just yet.
    We have searched and searched for suitable material but cannot anywhere find a sample application that :
    A. Lists contents of a databse table
    B. Each item in trhe list is a link to a page that allows that item, to be edited.
    C. A new item can be added.
    D. Uses the MVC model of JSP/Servlet and bean (preferably with no custom tags)
    There are examples that are too simplistic and do not cover the whole picture. Having spent over 100 GBP on books lately, only to be disappointed with the examples provided, we need to see some sample code.
    The samples provided by Oracle are too simplistic. They should really have provided ones built around the EMP and DEPT tables.
    Anyone know where we can get hold of this sample code.

    At the risk of sounding really dumb the examples are just too complex. There does not appear to be anywhere on the web where I can find a simple JSP/servlet/bean example of the type I described. There is enouigh material describing each individual component, but what I need is an example to cement the ideas, but the ones suggested are too much for a newbie. Even the much vaunted Pet Store thingy causes my eyes to glaze over.
    I dont expect anyone to have written something with my exact requirements, but surely to goodness there must be something that:
    1. On entry presents a search form on a table (e.g. EMP)
    2. On submission list all rows in EMp matchiung the criteria.
    3. The user can either click the link 'Edit' which opens up a form dispalying the row allowing the user to edit and save the changes, or click the 'New' button to show a blank form to create a new EMP.
    All this via a Controller servlet, with the database logic handled by a java bean, and all the presentation done via JSP.
    To me this is the most obvious and instructive example of this technology, but after days of trawling the web, and looking through a number of books, I cannot find such a thing.
    CGI with Perl DBI/DBD was a breeze to work with compared to this stuff ..... maybe ASP with SQL/Server would be a more fruitful use of time.

  • Noob JSP + Servlet + EJB information for building J2EE simple web project.

    I am new to Java. Covered basics and now jumping into making a simple web project. Project with functionality as below
    1- CSS and Javascript use.
    2- Managing user information (Add, Update, Delete, List)
    3- Login form (Pass username, password and authenticate to create cookie)
    4- Success/failure page.
    That's what I want to make. I have lots of ASP.NET experience so its better to learn from making a project.
    I need help like
    1- Anyone know any open source web project from which I can learn to complete above tasks.
    2- Any good latest J2EE 6 books to cover JSP, Servlts and EJB to make website.
    3- Any video tutorials.
    I am also looking around for the above information.
    Thanks

    pirzada wrote:
    Is it better approach to keep business logic in Beans instead of Servlet/JSP. Looked more robust and clean?Usually you should keep the business logic (i.e. code) away from JSPs. That's how things were done 10 years ago, now we know better. Servlets and JSP can be used together so that a servlet has the business logic and JSPs are just "dumb views".
    EJBs will/can help you when you need to worry about transaction isolation.
    Then there's the dozens of other Java frameworks used for web design (and other purposes).
    And the learning curve is high because it's a huge chunk of different technologies. It'll take you months to get proficient, years to become good.
    But if you just want to whip up some web pages quickly, look at JSP/JSTL and Servlets. That'll give you a clean, but basic approach.

  • Ias support for EJB, JSP/servlets,JDBC, connection pooling, XML, SOAP, load balancing etc

    Please let me know where I can find more information regarding iPlanet usage/deployment/configuring/tuning etc for support of technologies - like EJB, JSP/servlets, JDBC, connection pooling, XML, load balancing, JDBC & Transactions
    (I have already read the 'Getting Started with the iPlanet Application Server' part five and six - http://developer.iplanet.com/appserver/testdrive/partfive.jsp and partsix.jsp)(I am using the ias testdrive version).

    Hi,
    It's difficult to explain unless the J2EE architecture is understood. Also, explaining things like load balancing, Transactions, tuning, are bit vague and could blow the disk space of this site.
    To get started, the best way is to test the sample applications and the best part is you don't require internet connection to follow each steps. Install iWS and iAS, open browser, type in http://hostname:port/ias-samples/index.html. You can find links to the sample applications bundled. Please follow the steps given on deploying the application. This will enable you to a higher level.
    Regards
    Ganesh .R
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • 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 get an ArrayList Object in servlet from JSP?

    How to get an ArrayList Object in servlet from JSP?
    hi all
    please give the solution for this without using session and application...
    In test1.jsp file
    i am setting values for my setter methods using <jsp:usebean> <jsp:setproperty> tags as shown below.
    After that i am adding the usebean object to array list, then using request.setAttribute("arraylist object")
    ---------Code----------
    <jsp:useBean id="payment" class="com.common.PaymentHandler" scope="request" />
    <jsp:setProperty name="payment" property="strCreditCardNo" param="creditCardNumber" />
    <%-- <jsp:setProperty name="payment" property="iCsc" param="securityCode" /> --%>
    <jsp:setProperty name="payment" property="strDate" param="expirationDate" />
    <jsp:setProperty name="payment" property="strCardType" param="creditCardType" />
    <%--<jsp:setProperty name="payment" property="cDeactivate" param="deactivateBox" />
    <jsp:setProperty name="payment" property="fAmount" param="depositAmt" />
    <jsp:setProperty name="payment" property="fAmount" param="totalAmtDue" /> --%>
    <jsp:useBean id="lis" class="java.util.ArrayList" scope="request">
    <%
    lis.add(payment);
    %>
    </jsp:useBean>
    <%
    request.setAttribute("lis1",lis);
    %>
    -----------Code in JSP-----------------
    In testServlet.java
    i tried to get the arraylist object in servlet using request.getAttribute
    But I unable to get that arrayObject in servlet.....
    So if any one help me out in this, it will be very helpfull to me..
    Thanks in Advance
    Edward

    Hi,
    Im also facing the similar problen
    pls anybody help..
    thax in advance....
    Litty

  • 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

Maybe you are looking for

  • Error While saving new customer record,

    Hi, I have changed properties of the field PARTNER1 in the application crmm_account, to search for customer. The requirement is that account ID must have URL to ODC. I just copied same properties under Object link of BP_NAME1. But after saving the se

  • UNABLE TO OPEN MASTER ITEM FORM OF ORACLE APPLICATIONS: 11.5.10.2 IN FORMS6

    Hi All, I am beginner in oracle apps technical, Using Oracle Application 11.5.10.2 I am not able open INVIDITM.fmb( Inventory Master Item Forms) in form 6i. Getting a mysterious error that Oracle Forms Designer has encountered a problem and needs to

  • FIX FOR OUTLOOK CONTACT - CALENDAR SYNC PROBLEMS

    OK Guys. I have figured out the problem with Itunes not syncing the OUTLOOK CONTACTS & CALENDAR EVENT PROBLEM (For those who have this problem). So without further due.... 1) Go to Outlook/Tools/Option/Others/Advanced Options/ADDIN MANAGER 2) Remove

  • AMD 700 FirePro Graphics Card

    Who wants to watch a grown man cry?  I spent a small fortune on a shiny new mac with 64GB Ram and to quote Larry Jordan, "I could rocket to the moon with the power of this computer."  I am running OSX (10.9.5) and have a 12 gig per channel ethernet M

  • Remove folder in Message

    Dear All, I am newbie using E90, just bought for a week ago, 2 days ago I made new folder in Massage (under My folder), I like to remove it but can`t find out how to do that, any help? Thank you before