RE: Look up a EJB from a JSP?

2000-05-23 Thread Kalvar, Kirk

If you're interested in looking at other schemes, look at Sun's Model View
Controller (MVC) for their Pet Store Demo.
http://developer.java.sun.com/developer/Books/DesignEntApps/  

Kirk S. Kalvar, Software Engineer
DRS Electronic Systems Group

 -Original Message-
 From: Rick Horowitz [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, May 22, 2000 21:04
 To:   Orion-Interest
 Cc:   Orion-Interest
 Subject:  Re: Look up a EJB from a JSP?
 
 I am also trying to work out an overall architecture using JSP and EJB. 
 Although I cannot answer your question directly, here's what I'm
 thinking for my system.  Perhaps others will comment on this.  
 
 I'm planning to use a servlet to handle all http requests from
 browsers.  The servlet will dispatch the request internally to a
 processing object for that request.  The processing object will make a
 request or requests to the EJB layer, sometimes to SessionBeans and
 sometimes to EntityBeans.  The servlet will then forward the request to
 a JSP for display of the output.  In order to communicate the response
 to the display JSP, the servlet will add one or more response objects to
 the servlet session so they can be used as beans by the JSP.  AFAIK (but
 I haven't tried this yet) it shouldn't matter whether the bean is a
 local JavaBean that is created by the servlet from its response obtained
 from the EBJ layer, a remote object communicated back from EJB as the
 response using serialization, or an EntityBean remote object.  As long
 as it adheres to the JavaBean requirements of JSP, the JSP page should
 be able to display the response. 
 
 btw, I'm using a servlet to process responses because I think it
 provides a more unified way of dealing with what responses are legal in
 whatever state the user's session happens to be in, and what next page
 should be displayed.
 
 I'm sure that custom tags have a place in this architecture, as well, to
 further insulate the html generation done by the JSPs from the Java code
 used to process responses and generate dynamic content, but I haven't
 gotten this far as yet.
 
 Hope this helps, and I'd be interested in hearing some comments about my
 proposed architecture.
 
 Thanks,
 
 Rick Horowitz
 
 Tung Bui wrote:
  
  Hi, as part of my learning, I tried to implement a dynamic page as
 follow:
  JSP-Java Bean-EJB-JDBC. I got it works as intended however with a
  hack. Within the my Java Bean, in order to look up the EJB bean
  successfully, I have to hard code the context info as follow:
  Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY,
 
 "com.evermind.server.ApplicationClientInitialContextFactory");
  env.put(Context.PROVIDER_URL,"ormi://localhost/linkcontent");
  env.put(Context.SECURITY_PRINCIPAL,"");
  env.put(Context.SECURITY_CREDENTIALS,"");
  Context ctx = new InitialContext(env);
  Which is not an ideal way. I'm having trouble from figuring out how to
 set
  these information up so that I do not have to hard code this way. Any
 idea?
  
  Thanks,
  Tung




Re: Look up a EJB from a JSP?

2000-05-23 Thread Eric Richardson

Hi,
The first two properties should be able to be put in a properties file such as
jndi.properties
usually on the classpath(maybe in the jre/lib directory). This can be read by
the system by the "InputStream Classloader.getResouceAsStream()" method. Orion
should allow for setting this for the system if it's not already loaded for
the client program. You should not have to write this code unless
you want the PROVIDER_URL to be dynamic and not from a property file.

The second two need to be set at runtime coming from the client program as
input.

Hope this helps,
Eric :-)


Tung Bui wrote:

 Hi, as part of my learning, I tried to implement a dynamic page as follow:
 JSP-Java Bean-EJB-JDBC. I got it works as intended however with a
 hack. Within the my Java Bean, in order to look up the EJB bean
 successfully, I have to hard code the context info as follow:
 Hashtable env = new Hashtable();
 env.put(Context.INITIAL_CONTEXT_FACTORY,
 "com.evermind.server.ApplicationClientInitialContextFactory");
 env.put(Context.PROVIDER_URL,"ormi://localhost/linkcontent");
 env.put(Context.SECURITY_PRINCIPAL,"");
 env.put(Context.SECURITY_CREDENTIALS,"");
 Context ctx = new InitialContext(env);
 Which is not an ideal way. I'm having trouble from figuring out how to set
 these information up so that I do not have to hard code this way. Any idea?

 Thanks,
 Tung





Please help - autoencode doesn't seem to work

2000-05-23 Thread Brien Voorhees

I'm having trouble getting the "autoencode-urls" feature to work. I'm
assuming that it will encode links such as HREF="/profile.jsp" in JSP files
and HTML files (or JUST JSP?).

I can't seem to get it to work, though. My orion-web.xml file has the
following :
orion-web-app
deployment-version="1.0rc1"
development="true"
jsp-cache-directory="./persistence"
temporary-directory="./temp"
servlet-webdir="/servlet/"

session-tracking autoencode-urls="true" /

session-tracking /
/orion-web-app


I think the docs say that autoencode-urls is "true" by default, so I
probably don't even need to specify it in my orion-web.xml but I tried it
just to make sure. Any help would be greatly appreciated. I'm hoping to
start beta-testing my site in the next few days

Thank you,
Brien Voorhees