RE: security question

2001-10-01 Thread Khorramrouz, Turaj

Hi Jonathan,
you don't have the problem with "RequestDispatching to JSPs underneath
WEB-INF"  in weblogic 5.1 with sp 10 any more.

regards, 

Turaj
 

-Original Message-
From: Jonathan M Crater [mailto:[EMAIL PROTECTED]]
Sent: Montag, 24. September 2001 17:49
To: [EMAIL PROTECTED]
Subject: security question


i'm using weblogic 5.1, which does not allow RequestDispatching to JSPs
underneath WEB-INF.  so i'm stuck keeping my JSPs outside WEB-INF.  as a
result,
i have to secure requests to both JSPs and actions.  securing the actions is
just a matter of sub-classing ActionServlet and providing logic to check for
certain secured paths.  the problem is i don't want to repeat the logic in
the JSPs--either through a tag library or otherwise.  does anyone have any
suggestions as to how best to prevent a situation where a user requests a
JSP page directly when it should have gone through the sub-classed
ActionServlet?  i was thinking of just setting a request parameter for each
request as it passes through the ActionServlet.  that way, in the JSP i can
just test for that value to determine whether the request went through the
proper channel.  if not, i can redirect to an error page.

thoughts?  suggestions?




pooling prepared statements.

2001-10-01 Thread C O'Connor

Hi, 

I've been using the struts database connection pool successfully for a
while now, but without really thinking about it I've completely failed
to implement any sort of Prepared Statement pooling. I assume I need
to, I can imagine the threaded mess otherwise when our site goes live,
but can anyone recommend a good method / some code that will work well
with struts?

Caoilte O'Connor




Re: ejb design

2001-10-01 Thread Christophe Marchand

Wrong idea ! EJB entity are made to "store" one and only one record or
ValueObject. findByPrimaryKey entity method is designed to retrieve one
record, depending on a primary key object. If you use only one entity class
with a hashtable, you'll have a lot of problem to solve :
1 - your primary key object will be udge to store all data from all primary
key from all value objects,
2 - your value objects wouldn't able to extend a primary key object (are be
composed with)
3 - you will be obliged to use BMP (Bean managed persistance) entity beans,
with many sql statements in, and it we'll be very difficult to maintain when
you change your data model.
4 - if you decide in the future to split your database in two ones, and then
to deploy on two different servers, you'll keep a lot of unused code in your
classes (or you'll be obliged to re-write everything, both entity beans and
client-side jndi calls...)

Your solution is technically possible, but you are goi ng to spend a lot of
nights to maintain this, for no gain...

Have a look at "Mastering EJB's" book, which is very interesting on ejb's
design considerations...

Hope this helps.

Regards

- Original Message -
From: "Ali Ozoren" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 4:52 AM
Subject: ejb design


> hi all-
> i am pretty new at ejb and that might be a little off topic but here i go.
> instead of creating entity beans the conventional way, according to spec,
> would it be desirable to have one type of entity bean with a hashtable
> member to manipulate all the values and fields dynamically, accessing
fields
> by their string names.
>
> class ValueObject
> {
>  String name;
>  Object value;
> }
>
> class BaseEntityBean
> {
>  String id;
>  Hashtable fields; file://collection of ValueObjects, one row of data
becomes
> "columncount" times ValueObjects.
>
>  setField(String name, Object value);
>  Object getField(String name);
>  String getAsXML();
>  BaseEntityBean findByPrimaryKey; file://finds record, fills the "fields"
> variable using ResultSetMetaData
> }
>
> so for each different type of entity beans, we can inherit from
> BaseEntityBean, to create for instance AccountEntityBean that knows from
> which table it's going to get values.
>
> one obvious advantage is simplicity. one doesn't have to code setters and
> getters for all fields. another one would be addition of "custom" fields
by
> the user later on. when he does that custom fields would be equal to
what's
> already defined in the bean. hence no different way to handle custom
fields.
>
> then again, obvious disadvantage is speed. instantiating the ValueObjects
> and filling the hashtable takes more time. also, we are no longer using
the
> simple types for the sake of genericity which doesn't help the speed issue
> either.
>
> question is whether the benefits outweigh the speed disadvantage or not.
>
> also, is there anything against exposing a ResultSet type from an entity
> bean?
>
> i appreciate any input, thanks.
>
> --a
>
>
>




Re: tiles newbie problem

2001-10-01 Thread Cedric Dumoulin


  Hi,

  There was a problem preventing Tiles to run correctly with latest
commons-digester. This is now corrected.
  The error "Can't get component definition ..." usually happen when no definitions
exist, or when ActionServlet fails to start. In this later case, you can check
servlet log to see error (or acknowledge).

  The servlet can fail to start because bad jaxp (1.1 is required), bad validation,
...
  The validation can be turned on/off in web.xml :


  definitions-parser-validate
  true


If turned on, you should provide a DOCTYPE declaration :

 http://jakarta.apache.org/struts/dtds/tiles-config.dtd";>

  Take care that the name after DOCTYPE is the name of your root element. With
Tiles, it can be 'tiles-definition' or 'component-definitions'.

  When you turn on the definition debug, you should have in the output console, on
servlet startup, a big print with all your definitions . Also, you should have a
trace of all 'inserted' definitions/tiles when loading a page.

   Cedric


Nathan Coast wrote:

> Hi, I believe I have everything set up correctly - fairly obviously I don't.
>
> I have a simple page:
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
>
> 
>
> but when I browse to the page I get this error:
>
> javax.servlet.jsp.JspException: Error -  Tag Insert : Can't get component
> definition 'mypage'. Check if this name exist in component definitions.
> at org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:193)
>
> I think struts config is set up correctly and referring to the correct
> tilesDefinitions.xml and that file contains this:
>
>
>  
>  
>
>
>
>  
>  
>
>
>
>
>
>
>  
>
>
> yes I know all of the componenets are the same I'm just trying to achieve hello
> world :)
>
> Also I have debug turned on in web.xml:
>
> 
>definitions-debug
>1
>  
>
> I'm not seeing any tiles specific degug.  what debug should I expect to see?
>
> Thanks Nathan




Re: Authentication before struts

2001-10-01 Thread Peter Pilgrim


Still another way is to do what Debassish suggest and then add the
action listener classes in the way that Gary Geary suggests
in his "Advanced Java Server Pages" book. In the book
action events (nothing to do with JFC/Swing) are fired in the Preprocess
and the Postprocess stages.

--
Peter Pilgrim  |  |++44 (0)207-545-9923
 \  \  ___   /  / ... .
-     ( * )  ---   --
_Cafe_Savannah,_San Antonio,Ibiza__



 Message History 



From: Debasish Ghosh <[EMAIL PROTECTED]> on 28/09/2001 14:54 MST

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Re: Authentication before struts


what we have done is we have moved the authentication
totally at the controller level.
we have overridden the default implementation of
processPreprocess() method of ActionServlet in a
derived class and doing the authentication there.





--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.





database connection-pool

2001-10-01 Thread Antonio Lourinho

Hi,

i've been developing an app with Struts lately and i've reach the point
where i just have to make the database related work in order to acomplish
trasactional and persistence properties. To do so, i was thinking in using
the appropriate Oracle driver, but looking at the the Struts example i see
that there is a way to integrate a connection pool given certain parameters
in the struts-config.xml file. Can anyone give me a link where i can read
something more about it?

Antonio - Portugal


_
  INTERNET MAIL FOOTER 
A presente mensagem pode conter informação considerada confidencial.
Se o receptor desta mensagem não for o destinatário indicado, fica
expressamente proibido de copiar ou endereçar a mensagem a terceiros.
Em tal situação, o receptor deverá destruir a presente mensagem e por
gentileza informar o emissor de tal facto.
-
Privileged or confidential information may be contained in this
message. If you are not the addressee indicated in this message, you
may not copy or deliver this message to anyone. In such case, you
should destroy this message and kindly notify the sender by reply
email.
-




using link with multiple dynamic parameters

2001-10-01 Thread Anna Englund

Hi,

my problem is as follows:
I would like to use the  tag with multiple
dynamic parameters. I've tried to use the a
java.util.Map, but it seems to handle only fixed
values. Please, correct me if I'm wrong. 

In the example I'm iterating through a company list. I
create two links for each company in the list. The
first retrieves sets the company id in the companyID
parameter. The second creates a link with the company
name in the companyName parameter. Now, the question,
how do I  create a link with both parameters in the
same link? I would like to create a link as below for
each company in the list:
/company.do?flow=view&companyID=6&companyName=test

 
  
   
 

   
   
 

   
   
 
  

The global action forward viewCompany equals
company.do?flow=view

Any help and hints would be appreciated.
Thanks!
//Anna

__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com



saveToken() and resetToken() How Do You Use Them?

2001-10-01 Thread Peter Pilgrim

--
Peter Pilgrim  |  |++44 (0)207-545-9923
 \  \  ___   /  / ... .
-     ( * )  ---   --
_Cafe_Savannah,_San Antonio,Ibiza__



--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.





Re: TOMCAT 4.0

2001-10-01 Thread Michael Breion

Hi,

I didn't used Tomcat 4.0 for a long time, but as I remember, all "tomcat"
names were replaced by "Catalina" names (name of the project)...

So, you should find catalina.xml in place of toimcat.xml for configuration,
and something like catalina-apache.conf in place of tomcat-apache.conf ...

Hope this help ;-)

Michael
- Original Message -
From: "Jefferson Rodrigues de Oliveira e Silva"
<[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 28, 2001 12:55 PM
Subject: TOMCAT 4.0


> Hi all,
>
> I'm a very struts begginer... actually I'm still trying to install
> it and run the examples...
>
> I have apache + tomcat 4.0.  The point is that when installing the
> struts,
> there is a doc file that says to change the tomcat-apache.conf file,
> but it doesn't exist in tomcat 4.0
>
> Am I missing anything ?
>
> Sorry for this very begginer question.
>
> Cheers
> Jefferson.
>




Re: database connection-pool

2001-10-01 Thread C O'Connor

Its hidden away under the Utilities section on the website
http://jakarta.apache.org/struts/api/org/apache/struts/util/package-summary.html#doc.JDBC

and there's a little example of how to use it in the user guide
http://jakarta.apache.org/struts/userGuide/building_model.html#databases

should be plenty of meat there.

Caoilte O'Connor

On Mon, 1 Oct 2001, Antonio Lourinho wrote:

> Hi,
> 
> i've been developing an app with Struts lately and i've reach the point
> where i just have to make the database related work in order to acomplish
> trasactional and persistence properties. To do so, i was thinking in using
> the appropriate Oracle driver, but looking at the the Struts example i see
> that there is a way to integrate a connection pool given certain parameters
> in the struts-config.xml file. Can anyone give me a link where i can read
> something more about it?
> 
> Antonio - Portugal
> 
> 
> _
>   INTERNET MAIL FOOTER 
> A presente mensagem pode conter informagco considerada confidencial.
> Se o receptor desta mensagem nco for o destinatario indicado, fica
> expressamente proibido de copiar ou enderegar a mensagem a terceiros.
> Em tal situagco, o receptor devera destruir a presente mensagem e por
> gentileza informar o emissor de tal facto.
> -
> Privileged or confidential information may be contained in this
> message. If you are not the addressee indicated in this message, you
> may not copy or deliver this message to anyone. In such case, you
> should destroy this message and kindly notify the sender by reply
> email.
> -
> 
> 




RE: pooling prepared statements.

2001-10-01 Thread Adriano Labate

Hi,
A lot of people is using PoolMan. 

The next version due for release October 8 will support PreparedStatement
pooling.
See http://www.codestudio.com.

Adriano Labate

-Original Message-
From: C O'Connor [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 11:21 AM
To: [EMAIL PROTECTED]
Subject: pooling prepared statements.

Hi, 

I've been using the struts database connection pool successfully for a
while now, but without really thinking about it I've completely failed
to implement any sort of Prepared Statement pooling. I assume I need
to, I can imagine the threaded mess otherwise when our site goes live,
but can anyone recommend a good method / some code that will work well
with struts?

Caoilte O'Connor



Re: security question

2001-10-01 Thread Steven Valin

Interesting.  A reply from their tech support indicates that WebLogic 6 still
does not permit this, as do my own tests.

"Khorramrouz, Turaj" wrote:

> Hi Jonathan,
> you don't have the problem with "RequestDispatching to JSPs underneath
> WEB-INF"  in weblogic 5.1 with sp 10 any more.
>
> regards,
>
> Turaj
>
>
> -Original Message-
> From: Jonathan M Crater [mailto:[EMAIL PROTECTED]]
> Sent: Montag, 24. September 2001 17:49
> To: [EMAIL PROTECTED]
> Subject: security question
>
> i'm using weblogic 5.1, which does not allow RequestDispatching to JSPs
> underneath WEB-INF.  so i'm stuck keeping my JSPs outside WEB-INF.  as a
> result,
> i have to secure requests to both JSPs and actions.  securing the actions is
> just a matter of sub-classing ActionServlet and providing logic to check for
> certain secured paths.  the problem is i don't want to repeat the logic in
> the JSPs--either through a tag library or otherwise.  does anyone have any
> suggestions as to how best to prevent a situation where a user requests a
> JSP page directly when it should have gone through the sub-classed
> ActionServlet?  i was thinking of just setting a request parameter for each
> request as it passes through the ActionServlet.  that way, in the JSP i can
> just test for that value to determine whether the request went through the
> proper channel.  if not, i can redirect to an error page.
>
> thoughts?  suggestions?

--
Steven Valin
[EMAIL PROTECTED]





Antigen found =*.js file

2001-10-01 Thread ANTIGEN_NT_49613125

Antigen for Exchange found Struts.zip->error_Login.js matching =*.js file
filter.
The file is currently Removed.  The message, "JavaScript with html:errors -
new STRUTS validation", was
sent from Adam Grohs  and was discovered in IMC Queues\Inbound
located at ZDF/ZDF_MAINZ/NT_49613125.



Antigen found =*.js file

2001-10-01 Thread ANTIGEN_NT_49613125

Antigen for Exchange found Struts.zip->error_Lib.js matching =*.js file
filter.
The file is currently Removed.  The message, "JavaScript with html:errors -
new STRUTS validation", was
sent from Adam Grohs  and was discovered in IMC Queues\Inbound
located at ZDF/ZDF_MAINZ/NT_49613125.



Antigen found =*.js file

2001-10-01 Thread ANTIGEN_NT_49613125

Antigen for Exchange found flat files.zip->error_Lib.js matching =*.js file
filter.
The file is currently Removed.  The message, "JavaScript with html:errors -
new STRUTS validation", was
sent from Adam Grohs  and was discovered in IMC Queues\Inbound
located at ZDF/ZDF_MAINZ/NT_49613125.



Antigen found =*.js file

2001-10-01 Thread ANTIGEN_NT_49613125

Antigen for Exchange found flat files.zip->error_Login.js matching =*.js
file filter.
The file is currently Removed.  The message, "JavaScript with html:errors -
new STRUTS validation", was
sent from Adam Grohs  and was discovered in IMC Queues\Inbound
located at ZDF/ZDF_MAINZ/NT_49613125.



Losing ActionForwards

2001-10-01 Thread Matt Ho

I seem to have run into a problem with Struts 1.0 and ActionForwards.  
I have an action that has a relatively large number of ActionForwards 
(32 of them) that seems to work ok initially.  However, after a few 
minutes I get to the point where some random ActionForward stops working
I get a blank page.  Specifically, I get


HTTP/1.0 200 OK
Server: Resin/2.0.1
Content-Type: text/xml
Date: Mon, 01 Oct 2001 11:56:49 GMT

Any idea what might be going on?  That's really not very reassuring to
see that happen.

My environment:

* Windows 2000 Professional
* Resin 2.0.1 (as standalone)
* Java 1.3.1

--
Matt Ho
Principal
Indigo Egg, Inc.
Providing VoiceXML Professional Services






Unexpected behavior from html:link tag.

2001-10-01 Thread Roger Goerke

I am trying to use the html:link tag in a j2ee application and getting
unusual results.

The source code (in the jsp file)

  
 
  


When this code is evaluated it renders the following html
Demonstrate
  


Note: there is no matching close anchor tag and the enclosed text is
missing.
I have verified that the body of the html:link tag is evaluated but it is
not rendering
the enclosed information to the html file.  I have also verified that the
index.createAddress
text message exists in the Resource Bundle.  I have rendered that message
elsewhere
in the same jsp file.

Any ideas on this would be helpful.

Thanks,
Roger Goerke
Javelin Solutions




Re: ejb design

2001-10-01 Thread Dan Malks

Hi Ali,
You may be interested in the "Composite Entity" pattern in our book "Core J2EE
Patterns". It describes  creating course-grained Entities that manage finer
grained dependent objects, which are not implemented as Entity beans, but rather
pojos (Plain Old Java Objects).

The book includes numerous other patterns that may be of interest to you if you
are using Struts in comibination with a distributed business tier, such as
EJB-based services.

Good luck,
Dan

Ali Ozoren wrote:

> hi all-
> i am pretty new at ejb and that might be a little off topic but here i go.
> instead of creating entity beans the conventional way, according to spec,
> would it be desirable to have one type of entity bean with a hashtable
> member to manipulate all the values and fields dynamically, accessing fields
> by their string names.
>
> class ValueObject
> {
>  String name;
>  Object value;
> }
>
> class BaseEntityBean
> {
>  String id;
>  Hashtable fields; //collection of ValueObjects, one row of data becomes
> "columncount" times ValueObjects.
>
>  setField(String name, Object value);
>  Object getField(String name);
>  String getAsXML();
>  BaseEntityBean findByPrimaryKey; //finds record, fills the "fields"
> variable using ResultSetMetaData
> }
>
> so for each different type of entity beans, we can inherit from
> BaseEntityBean, to create for instance AccountEntityBean that knows from
> which table it's going to get values.
>
> one obvious advantage is simplicity. one doesn't have to code setters and
> getters for all fields. another one would be addition of "custom" fields by
> the user later on. when he does that custom fields would be equal to what's
> already defined in the bean. hence no different way to handle custom fields.
>
> then again, obvious disadvantage is speed. instantiating the ValueObjects
> and filling the hashtable takes more time. also, we are no longer using the
> simple types for the sake of genericity which doesn't help the speed issue
> either.
>
> question is whether the benefits outweigh the speed disadvantage or not.
>
> also, is there anything against exposing a ResultSet type from an entity
> bean?
>
> i appreciate any input, thanks.
>
> --a

--
Dan MalksSun Java Center
Enterprise Java Architect703.208.5794





Struts event programming !

2001-10-01 Thread emmanuel.boudrant


What do you about event programming in Java Server
Side programming ?

With this html button :

   
invoke method onAjouter(,,,)
 invoke method
onEnregistrer(,,,) 

Etc...


 
package  com.csi.controller;

// Struts
import  org.apache.struts.action.*;
// Servlet
import  javax.servlet.http.HttpServletRequest;
import  javax.servlet.http.HttpServletResponse;
// Import log4j classes.
import  org.apache.log4j.Category;
import  org.apache.log4j.BasicConfigurator;
// Reflect
import  java.lang.reflect.Method;


/**
 * Titre : MyAction.java
 * Description : Event Programming in Struts ;)
 * Copyright :Copyright (c) 2001
 * @author : [EMAIL PROTECTED]
 * @version 0.1a
 */
public abstract class MyAction extends Action {
static Category log =
Category.getInstance(MeeschaertAction.class);

public MyAction () {
}

public ActionForward perform (ActionMapping
mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws
java.io.IOException, javax.servlet.ServletException {

// Get submit parameter 'ok' value
// ex: 
String button = request.getParameter("ok");
if (button != null) {
// If ok, get the good method name 
// ex: onAjouter
String methodName = "on" +
button.toUpperCase().substring(0, 1)
+
button.toLowerCase().substring(1, button.length());
Method method = null;
Class thisAction = this.getClass();
Class param[] = new Class[4];
param[0] = ActionMapping.class;
param[1] = ActionForm.class;
param[2] = HttpServletRequest.class;
param[3] = HttpServletResponse.class;
try {
// Test if the method exist in
derived class
method =
thisAction.getDeclaredMethod(methodName, param);
Object value[] = new Object[4];
value[0] = mapping;
value[1] = form;
value[2] = request;
value[3] = response;
// Yes, so invoke it !
return 
(ActionForward)method.invoke(this, value);
} catch (NoSuchMethodException e) {
log.debug("EVT(" + e + "): No " +
methodName + "(,,,) found, using go(,,,)");
} catch (Exception e) {
log.warn("EVT(" + e + "): No " +
methodName + "(,,,) found, using go(,,,)",
e);
}
}
// Else invoke normal method
return  go(mapping, form, request, response);
}

public abstract ActionForward go (ActionMapping
mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws
java.io.IOException,
javax.servlet.ServletException;

}
 

Emmanuel,


___
Do You Yahoo!? -- Un e-mail gratuit @yahoo.fr !
Yahoo! Courrier : http://fr.mail.yahoo.com



Struts event programming ! ... re sorry

2001-10-01 Thread emmanuel.boudrant

What do you about event programming in Java Server
Side programming ?

With this html button :

   
invoke method onAjouter(,,,)
 invoke method
onEnregistrer(,,,) 

Etc...


 
package  com.csi.controller;

// Struts
import  org.apache.struts.action.*;
// Servlet
import  javax.servlet.http.HttpServletRequest;
import  javax.servlet.http.HttpServletResponse;
// Import log4j classes.
import  org.apache.log4j.Category;
import  org.apache.log4j.BasicConfigurator;
// Reflect
import  java.lang.reflect.Method;


/**
 * Titre : MyAction.java
 * Description : Event Programming in Struts ;)
 * Copyright :Copyright (c) 2001
 * @author : [EMAIL PROTECTED]
 * @version 0.1a
 */
public abstract class MyAction extends Action {
static Category log =
Category.getInstance(MeeschaertAction.class);

public MyAction () {
}

public ActionForward perform (ActionMapping
mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws
java.io.IOException, javax.servlet.ServletException {

// Get submit parameter 'ok' value
// ex: 
String button = request.getParameter("ok");
if (button != null) {
// If ok, get the good method name 
// ex: onAjouter
String methodName = "on" +
button.toUpperCase().substring(0, 1)
+
button.toLowerCase().substring(1, button.length());
Method method = null;
Class thisAction = this.getClass();
Class param[] = new Class[4];
param[0] = ActionMapping.class;
param[1] = ActionForm.class;
param[2] = HttpServletRequest.class;
param[3] = HttpServletResponse.class;
try {
// Test if the method exist in
derived class
method =
thisAction.getDeclaredMethod(methodName, param);
Object value[] = new Object[4];
value[0] = mapping;
value[1] = form;
value[2] = request;
value[3] = response;
// Yes, so invoke it !
return 
(ActionForward)method.invoke(this, value);
} catch (NoSuchMethodException e) {
log.debug("EVT(" + e + "): No " +
methodName + "(,,,) found, using go(,,,)");
} catch (Exception e) {
log.warn("EVT(" + e + "): No " +
methodName + "(,,,) found, using go(,,,)",
e);
}
}
// Else invoke normal method
return  go(mapping, form, request, response);
}

public abstract ActionForward go (ActionMapping
mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws
java.io.IOException,
javax.servlet.ServletException;

}
 

Emmanuel,


___
Do You Yahoo!? -- Un e-mail gratuit @yahoo.fr !
Yahoo! Courrier : http://fr.mail.yahoo.com



Struts event programming ! ... re sorry

2001-10-01 Thread emmanuel.boudrant
What do you about event programming in Java Server
Side programming ?

With this html button :

	
invoke method onAjouter(,,,)
	invoke method
onEnregistrer(,,,) 

Etc...


 
package  com.csi.controller;

// Struts
import  org.apache.struts.action.*;
// Servlet
import  javax.servlet.http.HttpServletRequest;
import  javax.servlet.http.HttpServletResponse;
// Import log4j classes.
import  org.apache.log4j.Category;
import  org.apache.log4j.BasicConfigurator;
// Reflect
import  java.lang.reflect.Method;


/**
 * Titre : MyAction.java
 * Description : Event Programming in Struts ;)
 * Copyright :Copyright (c) 2001
 * @author : [EMAIL PROTECTED]
 * @version 0.1a
 */
public abstract class MyAction extends Action {
static Category log =
Category.getInstance(MeeschaertAction.class);

public MyAction () {
}

public ActionForward perform (ActionMapping
mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws
java.io.IOException, javax.servlet.ServletException {

// Get submit parameter 'ok' value
// ex: 
String button = request.getParameter("ok");
if (button != null) {
// If ok, get the good method name 
// ex: onAjouter
String methodName = "on" +
button.toUpperCase().substring(0, 1)
+
button.toLowerCase().substring(1, button.length());
Method method = null;
Class thisAction = this.getClass();
Class param[] = new Class[4];
param[0] = ActionMapping.class;
param[1] = ActionForm.class;
param[2] = HttpServletRequest.class;
param[3] = HttpServletResponse.class;
try {
// Test if the method exist in
derived class
method =
thisAction.getDeclaredMethod(methodName, param);
Object value[] = new Object[4];
value[0] = mapping;
value[1] = form;
value[2] = request;
value[3] = response;
// Yes, so invoke it !
return 
(ActionForward)method.invoke(this, value);
} catch (NoSuchMethodException e) {
log.debug("EVT(" + e + "): No " +
methodName + "(,,,) found, using go(,,,)");
} catch (Exception e) {
log.warn("EVT(" + e + "): No " +
methodName + "(,,,) found, using go(,,,)",
e);
}
}
// Else invoke normal method
return  go(mapping, form, request, response);
}

public abstract ActionForward go (ActionMapping
mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws
java.io.IOException,
javax.servlet.ServletException;

}
 

Emmanuel,
Do You Yahoo!?
Yahoo! Courrier Un e-mail gratuit @yahoo.fr !

Struts event programming ! ... the good ...ouf

2001-10-01 Thread emmanuel.boudrant

Sorry but HTML mail is not easy with notepad.exe ;)



What do you about event programming in Java Server Side programming (using java.lang.reflect ?

With this html button :

		invoke method onAjouter(,,,)
	invoke method onEnregistrer(,,,) 

Etc...



package  com.csi.controller;

// Struts
import  org.apache.struts.action.*;
// Servlet
import  javax.servlet.http.HttpServletRequest;
import  javax.servlet.http.HttpServletResponse;
// Import log4j classes.
import  org.apache.log4j.Category;
import  org.apache.log4j.BasicConfigurator;
// Reflect
import  java.lang.reflect.Method;


/**
 * Titre : MyAction.java
 * Description : Event Programming in Struts ;)
 * Copyright :Copyright (c) 2001
 * @author : [EMAIL PROTECTED]
 * @version 0.1a
 */
public abstract class MyAction extends Action {
static Category log = Category.getInstance(MeeschaertAction.class);

public MyAction () {
}

public ActionForward perform (ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException {

// Get submit parameter 'ok' value
// ex: 
String button = request.getParameter("ok");
if (button != null) {
// If ok, get the good method name 
// ex: onAjouter
String methodName = "on" + button.toUpperCase().substring(0, 1)
+ button.toLowerCase().substring(1, button.length());
Method method = null;
Class thisAction = this.getClass();
Class param[] = new Class[4];
param[0] = ActionMapping.class;
param[1] = ActionForm.class;
param[2] = HttpServletRequest.class;
param[3] = HttpServletResponse.class;
try {
// Test if the method exist in derived class
method = thisAction.getDeclaredMethod(methodName, param);
Object value[] = new Object[4];
value[0] = mapping;
value[1] = form;
value[2] = request;
value[3] = response;
// Yes, so invoke it !
return  (ActionForward)method.invoke(this, value);
} catch (NoSuchMethodException e) {
log.debug("EVT(" + e + "): No " + methodName + "(,,,) found, using go(,,,)");
} catch (Exception e) {
log.warn("EVT(" + e + "): No " + methodName + "(,,,) found, using go(,,,)",
e);
}
}
// Else invoke normal method
return  go(mapping, form, request, response);
}

public abstract ActionForward go (ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws java.io.IOException,
javax.servlet.ServletException;

}
 

Emmanuel,



Do You Yahoo!?
Yahoo! Courrier Un e-mail gratuit @yahoo.fr !

Tomcat-Apache Struts Intergration?

2001-10-01 Thread Cameron Ingram

Hi All,

   I got tomcat and apache integrated and working together, however I do not seem to 
have the struts part configured correctly. I followed the installation directions to 
the letter on the web site.  I am using the struts example as my test. If I use tomcat 
directly(port 8080) every thing works great!  However when I use apache , and here is 
the weird thing, the only page that seems to be able to handle the .do extension is 
the logon page. In other words every thing else that has a .do associated to it will 
not work. Apache for some reason is trying to handle those pages. S is there any 
one out there using apache, tomcat and struts on netware, also could some one who has 
integrated the three successfully send me some instructions on how they did it? By the 
way I am using the latest version of Apache and Tomcat 3.3. Any help you guys could 
give would be great!





RE: Tomcat-Apache Struts Intergration?

2001-10-01 Thread Nortje, Andrew
Title: RE: Tomcat-Apache Struts Intergration?





Cameron


You need to tell apache which files will be served by Tomcat. You do this by adding entries in the httpd.conf file in $APACHE_HOME/conf directory

What I do in development is to get Tomcat to serve all the files in a given web app. So the entry in httpd.conf for a web app called jazz would be 

JkMount /jazz/* ajp12


Here is a cut and paste from my httpd.conf file. Notice I have set all .do and .jsp files to be handled by Tomcat.


In production one would need to be a bit more sophisticated.



LoadModule jk_module libexec\mod_jk.dll
 AddModule mod_jk.c
JkWorkersFile C:\java\j2ee\JBoss-2.4.1_Tomcat-3.2.3\tomcat\conf\workers.properties
JkLogFile C:\web\apache-1.3.20\Apache\logs\mod_jk.log
JkLogLevel    info


JkMount /*.jsp ajp12
JkMount /jazz/* ajp12
JkMount /struts-documentation/* ajp12
JkMount /*.do ajp12



-Original Message-
From: Cameron Ingram [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 01, 2001 10:27 AM
To: <
Subject: Tomcat-Apache Struts Intergration?


Hi All,


   I got tomcat and apache integrated and working together, however I do not seem to have the struts part configured correctly. I followed the installation directions to the letter on the web site.  I am using the struts example as my test. If I use tomcat directly(port 8080) every thing works great!  However when I use apache , and here is the weird thing, the only page that seems to be able to handle the .do extension is the logon page. In other words every thing else that has a .do associated to it will not work. Apache for some reason is trying to handle those pages. S is there any one out there using apache, tomcat and struts on netware, also could some one who has integrated the three successfully send me some instructions on how they did it? By the way I am using the latest version of Apache and Tomcat 3.3. Any help you guys could give would be great!




Re: Tomcat-Apache Struts Intergration?

2001-10-01 Thread Martin Samm

Cameron,

i went through the integration last week. I'm using 3.2.2 version of tomcat, 
apache v 1.3.19 and struts v 1.0

I, like yourself, had the Apache/tomcat intergation working fine. The 
instruction for then integrating Struts was wrong in one part - i presume you 
found the the instructions on how to integrate Struts when Apache/Tomcat are 
already intergated? There is one part which says to add a line for the '.do' 
into tomcat-apache.conf. This is wrong - at least for tomcat 3.2 onwards .

Modify mod_jk.conf-auto (i.e. start tomcat, which will re-gen the auto files, 
) before starting Apache.  Find the line 

JkMount *.jsp ajp12

Copy this and change it to 

JkMount *.do ajp12

(although in version 3.3 you may have the lines referring to ajp13, i dont 
know) - this file is the one read in by Apache - the instructions for 
Struts/Tomcat/Apache intergation references tomcat 3.2.1 after which i 
suspect the Apache / Tomcat integration instructions changed the file to put 
in apache's httpd.conf. 

Hope that helps


On Monday 01 Oct 2001 3:27 pm, you wrote:
> Hi All,
>
>I got tomcat and apache integrated and working together, however I do
> not seem to have the struts part configured correctly. I followed the
> installation directions to the letter on the web site.  I am using the
> struts example as my test. If I use tomcat directly(port 8080) every thing
> works great!  However when I use apache , and here is the weird thing, the
> only page that seems to be able to handle the .do extension is the logon
> page. In other words every thing else that has a .do associated to it will
> not work. Apache for some reason is trying to handle those pages. S is
> there any one out there using apache, tomcat and struts on netware, also
> could some one who has integrated the three successfully send me some
> instructions on how they did it? By the way I am using the latest version
> of Apache and Tomcat 3.3. Any help you guys could give would be great!

-- 
Martin Samm MSc



Help on Iterate within iterate

2001-10-01 Thread SUPRIYA MISRA

I need help on iterate within an iterate.

Outer Iterate is a ArrayList which contains an array
Inner Iterate is an array

The property needs to set on the JSP as text boxes.

Here is what I have (it works):-



  
  

//*** This needs to be iterated as inner loop

  <% fal.LocationHrs[] lList =pList.locationhrs;
  for (int i=0; i< lList.length;i ++){%>


   <%=lList[i].locationid%>   <%=lList[i].locationname%> 
 <%=lList[i].hours%> 
  
  <%}%>



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




Dreamweaver Custom Tag Support

2001-10-01 Thread Frédéric Houbie - ABSIS-GROUP



Hi, 

 
I'm trying to use 
this feature but when I had a  tag for exemple, I get this 
error
 
javax.servlet.ServletException :Cannot find ActionMappings 
or ActionFormBeans Collections. 
 
Is there something 
missing in my classpath ?
 
Thanks
 
Frederic


Struts action populate a list then display the jsp

2001-10-01 Thread Peter Pilgrim

Chicken and the egg

I have a data source and bean with a list of items
One JSP view that list the content of the data source.
I have one action.

I want to allow the user to choose an element from the data source.
My action populates the bean with the items, then go to the view.
The problem is that the user bookmarks the view and of course
there is no data in the bean. How do you populate the bean
without going into the action first?

What is the best practice of populating an a bean from the data
source?

Can you inside a JSP get a reference to an action or ask
Struts to create it if it has not done it yet? If you can do
that then you could call the action by pseudo action
to populate the bean?

Can you call an action without an action form?

--
Peter Pilgrim  |  |++44 (0)207-545-9923
 \  \  ___   /  / ... .
-     ( * )  ---   --
_Cafe_Savannah,_San Antonio,Ibiza__



--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.





Dynamic tiles definitions (was Re: tiles vs templates or both)

2001-10-01 Thread Cedric Dumoulin


  Hi,

  There is several way to have "dynamic definition".

  The first one is to write your own definitions factory implementing
'ComponentDefinitionsFactory'. The getDefinition() method is called each time you 
insert
a definition. So you can implement your own to serve your dynamic definition. You 
change
the factory used in web.xml. See the tiles-chanel.war as example.

  Another way is to associate an Action and a Tile. The action create and set the
definition or read it from factory, and push it to be used by Tiles. Your action use 
the
forward mechanism to forward directly to a Tile/jsp, or to a definition name. In this
later case, values set in your pushed definition overload values set by definition used
in forward.
  I'm currently writing a new example showing this features (dynamic portal 
customizable
by user). You can also check tiles-doc/test/testStrutsAction.jsp and
examples.tiles.test.TestActionTileAction.java.

  Cedric



Nathan Coast wrote:

> Thanks Cedric, I'll give that a go.
>
> Looking in tiles\web\doc\web-inf\tilesDefinitions.xml I found
>
>   
>   
>   
> 
> 
> 
> 
>   
>   
> 
> 
> 
> 
> 
>   
>
>
> is there any way that this can be done dynamically? so the portal page could be
> customised for each user?
>
> Cheers
> Nathan
>
> Cedric Dumoulin wrote:
>
> >   Hi Nathan,
> >
> >   Tiles are compatible with templates. This mean that you can use Tiles in place of
> > templates.
> >   This can be done with a minimum effort by replacing the template tld declaration
> > in web.xml :
> >
> >   
> > /WEB-INF/template.tld
> > /WEB-INF/tiles.tld
> >   
> >
> >   If you use only template tags, then continue to use original template.
> > If you also use tiles tags or features, then use tiles library instead of templates
> > one.
> > You can still have both prefix in your jsp files if you wish.
> >
> >   Hope this help,
> >
> > Cedric
> >
> >
> > Nathan Coast wrote:
> >
> >
> >>Hi,
> >>
> >>I've been looking at tiles and not sure whether its best to use tiles layouts or
> >>struts templates or some mix of the two.  We've currently got a site implemented
> >>using templates but would be looking to implement a portal-like page possibly
> >>using tiles functionality to provide the component layout.
> >>
> >>I'm a bit concerned that using tiles layouts would result in two page layout
> >>mechanisms within one app (tiles and templates).
> >>
> >>Cheers
> >>Nathan
> >>
> >
> >




Re: Dreamweaver Custom Tag Support

2001-10-01 Thread Christophe Marchand



Yes it does ! I've spend all the night on this 
problem. Try to print your classpath and check it.

  - Original Message - 
  From: 
  Frédéric 
  Houbie - ABSIS-GROUP 
  To: Struts-User 
  Sent: Monday, October 01, 2001 4:05 
  PM
  Subject: Dreamweaver Custom Tag 
  Support
  
  Hi, 
  
   
  I'm trying to use 
  this feature but when I had a  tag for exemple, I get this 
  error
   
  javax.servlet.ServletException :Cannot find 
  ActionMappings or ActionFormBeans Collections. 
   
  Is there something 
  missing in my classpath ?
   
  Thanks
   
  Frederic


AND/OR with logic tags

2001-10-01 Thread Eric Rizzo

Sorry if this has already been asked/answered here - the mail archive doesn't 
let me search for "AND OR".

Is there a way to have multiple conditional logic with the Struts logic taglib? 
  For example, "IF (user is present) OR (visitor equals true)".

TIA,
Eric
-- 
Eric Rizzo, Software Engineer
OpenNetwork Technologies
http://www.opennetwork.com
-
I embrace my personality flaws, for without them
I might have no personality at all.




Problems with html:base under jdk1.4 and jrun

2001-10-01 Thread Lorenz, Manfred



Hi all, 
 
i have the following 
problem.
I've installed jdk1.4 / JRun 3.1 / struts1.0. and got 
the effect that all 
relative paths are 
incorrect.
 
At my test-installation: jdk1.4 / Tomcat 3.2.3 / 
struts1.0 i have no problems.
 
Does anyone know how to solve this problem 
?
 
Thanks
 
Manfred


Re: Struts action populate a list then display the jsp

2001-10-01 Thread Ted Husted

The best thing is to link only to ActionMappings and never to JSPs. Then
they can only bookmark the mapping. If anything is missing, it is much
easier to handle that from an Action than from a JSP.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/about/struts/


Peter Pilgrim wrote:
> 
> Chicken and the egg
> 
> I have a data source and bean with a list of items
> One JSP view that list the content of the data source.
> I have one action.
> 
> I want to allow the user to choose an element from the data source.
> My action populates the bean with the items, then go to the view.
> The problem is that the user bookmarks the view and of course
> there is no data in the bean. How do you populate the bean
> without going into the action first?
> 
> What is the best practice of populating an a bean from the data
> source?
> 
> Can you inside a JSP get a reference to an action or ask
> Struts to create it if it has not done it yet? If you can do
> that then you could call the action by pseudo action
> to populate the bean?
> 
> Can you call an action without an action form?
> 
> --
> Peter Pilgrim  |  |++44 (0)207-545-9923
>  \  \  ___   /  / ... .
> -     ( * )  ---   --
> _Cafe_Savannah,_San Antonio,Ibiza__
> 
> --
> 
> This e-mail may contain confidential and/or privileged information. If you are not 
>the intended recipient (or have received this e-mail in error) please notify the 
>sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
>distribution of the material in this e-mail is strictly forbidden.



Re: Struts action populate a list then display the jsp

2001-10-01 Thread Peter Pilgrim



A real shame!

To answer my on own question.

The only way it does work though is by hard coded scriptlets or by
writing custom DB tags that populate the beans with item from the
database in the JSP. Then you can surely guarantee that
when the surfer hits the "submit" button that the data you
are receiving are correct?
--
Peter Pilgrim  |  |++44 (0)207-545-9923
 \  \  ___   /  / ... .
-     ( * )  ---   --
_Cafe_Savannah,_San Antonio,Ibiza__



 Message History 



From: Peter Pilgrim/DMGIT/DMG UK/DeuBa@DMG UK on 01/10/2001 16:04

Please respond to [EMAIL PROTECTED]

Chicken and the egg

I have a data source and bean with a list of items
One JSP view that list the content of the data source.
I have one action.

I want to allow the user to choose an element from the data source.
My action populates the bean with the items, then go to the view.
The problem is that the user bookmarks the view and of course
there is no data in the bean. How do you populate the bean
without going into the action first?

What is the best practice of populating an a bean from the data
source?

Can you inside a JSP get a reference to an action or ask
Struts to create it if it has not done it yet? If you can do
that then you could call the action by pseudo action
to populate the bean?

Can you call an action without an action form?





--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.





Trouble with setting and retrieving cookie values

2001-10-01 Thread Robin Whitley

I am having a problem with setting and retrieving cookies within an action
class.  From a servlet with a simple test I can set and retrieve cookie
values, with the example code below:

Setting the cookie:

Cookie c = new Cookie("test", "testvalue");
c.setMaxAge(60*60*24*90);
c.setPath("/");
res.addCookie(c);

Retrieving the cookie:

 Cookie[] cookies = request.getCookies();
 if (cookies != null && cookies.length > 0) { // Cookie(s) found
  for (int i = 0; i < cookies.length; i++) {
   if ((cookies[i].getName()).equals("test")) {
   cookievalue = cookies[i].getValue();
}
}
}

As soon as I put the code in an action class and I either forward, or
redirect to a jsp, the cookie information is not saved.  Does anyone have
any clues as to why the same code is not working within the action class?
Any help would be appreciated.


Robin Whitley



Re: Struts action populate a list then display the jsp

2001-10-01 Thread Peter Pilgrim



Ah! but what if your action redirects to a view JSP, and then they book mark that?
Are we talking the same lingo here. What do you mean by link to action mappings ?
--
Peter Pilgrim  |  |++44 (0)207-545-9923
 \  \  ___   /  / ... .
-     ( * )  ---   --
_Cafe_Savannah,_San Antonio,Ibiza__



 Message History 



From: Ted Husted <[EMAIL PROTECTED]> on 01/10/2001 12:20 AST

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Re: Struts action populate a list then display the jsp


The best thing is to link only to ActionMappings and never to JSPs. Then
they can only bookmark the mapping. If anything is missing, it is much
easier to handle that from an Action than from a JSP.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/about/struts/


Peter Pilgrim wrote:
>
> Chicken and the egg
>
> I have a data source and bean with a list of items
> One JSP view that list the content of the data source.
> I have one action.
>
> I want to allow the user to choose an element from the data source.
> My action populates the bean with the items, then go to the view.
> The problem is that the user bookmarks the view and of course
> there is no data in the bean. How do you populate the bean
> without going into the action first?
>
> What is the best practice of populating an a bean from the data
> source?
>
> Can you inside a JSP get a reference to an action or ask
> Struts to create it if it has not done it yet? If you can do
> that then you could call the action by pseudo action
> to populate the bean?
>
> Can you call an action without an action form?



--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.





Re: Struts action populate a list then display the jsp

2001-10-01 Thread Jonathan M Crater

the idea is not to have your JSPs available for bookmarking.  if all your links point 
to action mappings (e.g., *.do URIs) and you do forwards to all your JSPs, then a JSP 
will never be visible in the URL pane of the user's browser.  that way, s/he can never 
bookmark a JSP which could conceivably be displayed in an
uninitialized state.

Peter Pilgrim wrote:

> Ah! but what if your action redirects to a view JSP, and then they book mark that?
> Are we talking the same lingo here. What do you mean by link to action mappings ?
> --
> Peter Pilgrim  |  |++44 (0)207-545-9923
>  \  \  ___   /  / ... .
> -     ( * )  ---   --
> _Cafe_Savannah,_San Antonio,Ibiza__
>
>  Message History 
>
>
> From: Ted Husted <[EMAIL PROTECTED]> on 01/10/2001 12:20 AST
>
> Please respond to [EMAIL PROTECTED]
>
> To:   [EMAIL PROTECTED]
> cc:
> Subject:  Re: Struts action populate a list then display the jsp
>
> The best thing is to link only to ActionMappings and never to JSPs. Then
> they can only bookmark the mapping. If anything is missing, it is much
> easier to handle that from an Action than from a JSP.
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel +1 716 737-3463
> -- http://www.husted.com/about/struts/
>
> Peter Pilgrim wrote:
> >
> > Chicken and the egg
> >
> > I have a data source and bean with a list of items
> > One JSP view that list the content of the data source.
> > I have one action.
> >
> > I want to allow the user to choose an element from the data source.
> > My action populates the bean with the items, then go to the view.
> > The problem is that the user bookmarks the view and of course
> > there is no data in the bean. How do you populate the bean
> > without going into the action first?
> >
> > What is the best practice of populating an a bean from the data
> > source?
> >
> > Can you inside a JSP get a reference to an action or ask
> > Struts to create it if it has not done it yet? If you can do
> > that then you could call the action by pseudo action
> > to populate the bean?
> >
> > Can you call an action without an action form?
>
> --
>
> This e-mail may contain confidential and/or privileged information. If you are not 
>the intended recipient (or have received this e-mail in error) please notify the 
>sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
>distribution of the material in this e-mail is strictly forbidden.





Re: Struts action populate a list then display the jsp

2001-10-01 Thread Christophe Marchand



I think a browser can only store the requested URL, 
not the redirect-to one... So you can only bookmark the requested URL, which is 
your action...
 
Linking to an action mapping is something like 

    
    
forward="/tour.jsp">    
 
- Original Message - 
From: "Peter Pilgrim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 6:43 PM
Subject: Re: Struts action populate a list then 
display the jsp
> > > Ah! but what if 
your action redirects to a view JSP, and then they book mark that?> Are 
we talking the same lingo here. What do you mean by link to action mappings 
?> --> Peter 
Pilgrim  |  
|    ++44 (0)207-545-9923> 
     \  
\  ___   /  / ... .> 
    -   
  ( * )  ---   --> 
_Cafe_Savannah,_San Antonio,Ibiza__> > 
> >  Message History 
> > > From: Ted 
Husted <[EMAIL PROTECTED]> on 01/10/2001 
12:20 AST> > Please respond to [EMAIL PROTECTED]> 
> To:   [EMAIL PROTECTED]> 
cc:> Subject:  Re: Struts action populate a list then display the 
jsp> > > The best thing is to link only to ActionMappings 
and never to JSPs. Then> they can only bookmark the mapping. If anything 
is missing, it is much> easier to handle that from an Action than from a 
JSP.> > -- Ted Husted, Husted dot Com, Fairport NY USA.> -- 
Custom Software ~ Technical Services.> -- Tel +1 716 737-3463> -- 
http://www.husted.com/about/struts/> > > Peter Pilgrim wrote:> >> > 
Chicken and the egg> >> > I have a data source and bean with 
a list of items> > One JSP view that list the content of the data 
source.> > I have one action.> >> > I want to 
allow the user to choose an element from the data source.> > My action 
populates the bean with the items, then go to the view.> > The problem 
is that the user bookmarks the view and of course> > there is no data 
in the bean. How do you populate the bean> > without going into the 
action first?> >> > What is the best practice of populating 
an a bean from the data> > source?> >> > Can you 
inside a JSP get a reference to an action or ask> > Struts to create 
it if it has not done it yet? If you can do> > that then you could 
call the action by pseudo action> > to populate the bean?> 
>> > Can you call an action without an action form?> 
> > > --> > This e-mail may contain 
confidential and/or privileged information. If you are not the intended 
recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.> 
> > 


Support of Struts in IBM Websphere 4.0

2001-10-01 Thread Scott Ryan

I have heard a rumor that IBM was going to deliver a fix to 4.0 of
Websphere that would allow struts based applications to run in that
environment.  Does anyone know when that fix is due.  We have received
4.0.1 but there is no indication whether the bug is fixed.  We would
like to move from 3.5.4 to 4.0 but don't want to support the workarounds
any longer

Thanks

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044



required tag in struts

2001-10-01 Thread prakhar



I have to show all required fields with * sign at 
the end. Do we have any struts tag which can do this.
 
 
Thanks
Prakhar


Re: Support of Struts in IBM Websphere 4.0

2001-10-01 Thread SLBrand
Scott,

I and a number of others are already using Struts (1.0) in WAS 4.0.0 and it works fine.

Here to help,
Stephen :-{)

Stephen Brand
Software Architect
[EMAIL PROTECTED]



html:link and bean:message usage together

2001-10-01 Thread Sean

Hello All,

I am trying to dynamically load a URL from the ApplicationResources file via
the bean:message tag in order to make it the href target of a html:link or a
">something

nothing, also tried:

">something

still nothing ... I also tried escaping the " marks in the bean:message tag
that didn't work either.  Basically I want a attribute in the html:link tag
that allows you  to specify a message resource or I want to be able to save
the value from the bean:message tag away into a variable.  Or, finally I
need to know how via a JSP I can get a handle to the MessageResources and
extract the url I need from the resource bundle.

Hasn't anyone else wanted to put regional specific URL's into their
ApplicationResources.properties files to have different locals link to
different web sites based on location?  Seems like a pretty common thing to
me ... I hope this is enough info ... let me know if you need anything else.

Sean




RE: Support of Struts in IBM Websphere 4.0

2001-10-01 Thread Assenza, Chris



This 
is true! :) Not sure what they'd be patching it outside of upgrading their 
servlet spec to take care of an un-patched form tag. 
 
Chris
 
Christopher Assenza Phone:  412.201.6026 Fax: 412.201.6060 Email:  [EMAIL PROTECTED] ACCESSDATA 
Moving Your Business from Point A to Point 
e.SM 
http://www.accessdc.com/ 

  -Original Message-From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, October 01, 2001 1:39 
  PMTo: [EMAIL PROTECTED]Subject: Re: Support 
  of Struts in IBM Websphere 4.0Scott, I and a number of others are 
  already using Struts (1.0) in WAS 4.0.0 and it works fine. Here to 
  help, Stephen :-{) Stephen Brand Software Architect 
  [EMAIL PROTECTED] 


Re: database connection-pool

2001-10-01 Thread Craig_Reichenbach


I would look at alternatives to the generic connection pooling.  I have
found it unreliable under heavy load.  Poolman is a good alternative.
Furthermore Ted H. indicates generic pooling could be deprecated in later
releases of Struts.  It's fine for getting started but I wouldn't depend on
it.

-Craig




   

"Antonio Lourinho" 

  

rsoft.com>   cc: (bcc: Craig 
Reichenbach/CAM/Lotus)
 Subject: database connection-pool 

10/01/2001 06:05   

AM 

Please respond to  

struts-user

   

   





Hi,

i've been developing an app with Struts lately and i've reach the point
where i just have to make the database related work in order to acomplish
trasactional and persistence properties. To do so, i was thinking in using
the appropriate Oracle driver, but looking at the the Struts example i see
that there is a way to integrate a connection pool given certain parameters
in the struts-config.xml file. Can anyone give me a link where i can read
something more about it?

Antonio - Portugal


_
  INTERNET MAIL FOOTER
A presente mensagem pode conter informação considerada confidencial.
Se o receptor desta mensagem não for o destinatário indicado, fica
expressamente proibido de copiar ou endereçar a mensagem a terceiros.
Em tal situação, o receptor deverá destruir a presente mensagem e por
gentileza informar o emissor de tal facto.
-
Privileged or confidential information may be contained in this
message. If you are not the addressee indicated in this message, you
may not copy or deliver this message to anyone. In such case, you
should destroy this message and kindly notify the sender by reply
email.
-








Tomcat 4.0 and Struts.

2001-10-01 Thread Domingo Aguilera

Is there any issue regarding the use of Tomcat 4.0 and struts when dealing
with the "digester parsing" of the struts-config.xml ?

This is what´s been written to log file in tomcat 4.0

2001-10-01 11:28:58 StandardContext[/extranet]: Servlet /extranet threw
load() exception
javax.servlet.ServletException: Servlet.init() for servlet action threw
exception
at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
at org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)
at org.apache.catalina.core.StandardContext.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
at org.apache.catalina.core.StandardHost.addChild(Unknown Source)
at org.apache.catalina.core.StandardHost.install(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
at org.apache.catalina.startup.HostConfig.start(Unknown Source)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown
Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)
at org.apache.catalina.startup.Catalina.start(Unknown Source)
at org.apache.catalina.startup.Catalina.execute(Unknown Source)
at org.apache.catalina.startup.Catalina.process(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:28)
at java.lang.reflect.Method.invoke(Method.java:313)
at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
- Root Cause -
java.lang.NullPointerException
at org.apache.commons.digester.Digester.parse(Digester.java:859)
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1273)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:460)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
at org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)
at org.apache.catalina.core.StandardContext.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
at org.apache.catalina.core.StandardHost.addChild(Unknown Source)
at org.apache.catalina.core.StandardHost.install(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
at org.apache.catalina.startup.HostConfig.start(Unknown Source)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown
Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)
at org.apache.catalina.startup.Catalina.start(Unknown Source)
at org.apache.catalina.startup.Catalina.execute(Unknown Source)
at org.apache.catalina.startup.Catalina.process(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:28)
at java.lang.reflect.Method.invoke(Method.java:313)
at org.apache.catalina.startup.Bootstrap.main(Unknown Source)

This is the struts-config.xml ( with some changes to not show password ,
etc.)

struts-config.xml--



http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>






  
  
  
  
  
  
  
  

  

  
  


  


  
  

 

  


  
  








 


 














  



--- end of struts-config.xml 


This app was running well in tomcat 3.3 b2

jakarta-struts and jakarta-commons jar files are from September 19th.

XML SAX parser is Xerces 1.4.1 whose jar file is in
$TOMCAT/webapps/myapp/lib

O.S. Windows Millenium

Java version is 1.4 beta2

Any suggestions ?








RE: Tomcat 4.0 and Struts.

2001-10-01 Thread Domingo Aguilera

I made a mistake when writing about the location of the xml parser...

It is Xerces 1.4.1 and is placed in $TOMCAT/webapps/myapp/WEB-INF/lib

-Mensaje original-
De: Domingo Aguilera [mailto:[EMAIL PROTECTED]]
Enviado el: Lunes, 01 de Octubre de 2001 12:47 p.m.
Para: [EMAIL PROTECTED]
Asunto: Tomcat 4.0 and Struts.


Is there any issue regarding the use of Tomcat 4.0 and struts when dealing
with the "digester parsing" of the struts-config.xml ?

This is what´s been written to log file in tomcat 4.0

2001-10-01 11:28:58 StandardContext[/extranet]: Servlet /extranet threw
load() exception
javax.servlet.ServletException: Servlet.init() for servlet action threw
exception
at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
at org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)
at org.apache.catalina.core.StandardContext.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
at org.apache.catalina.core.StandardHost.addChild(Unknown Source)
at org.apache.catalina.core.StandardHost.install(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
at org.apache.catalina.startup.HostConfig.start(Unknown Source)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown
Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)
at org.apache.catalina.startup.Catalina.start(Unknown Source)
at org.apache.catalina.startup.Catalina.execute(Unknown Source)
at org.apache.catalina.startup.Catalina.process(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:28)
at java.lang.reflect.Method.invoke(Method.java:313)
at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
- Root Cause -
java.lang.NullPointerException
at org.apache.commons.digester.Digester.parse(Digester.java:859)
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1273)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:460)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
at org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)
at org.apache.catalina.core.StandardContext.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
at org.apache.catalina.core.StandardHost.addChild(Unknown Source)
at org.apache.catalina.core.StandardHost.install(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
at org.apache.catalina.startup.HostConfig.start(Unknown Source)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown
Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)
at org.apache.catalina.startup.Catalina.start(Unknown Source)
at org.apache.catalina.startup.Catalina.execute(Unknown Source)
at org.apache.catalina.startup.Catalina.process(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:28)
at java.lang.reflect.Method.invoke(Method.java:313)
at org.apache.catalina.startup.Bootstrap.main(Unknown Source)

This is the struts-config.xml ( with some changes to not show password ,
etc.)

struts-config.xml--



http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>






  
  
  
  
  
  
  
  

  

  
  


  


  
  

 

  


  
  








 


 














  



--- end of struts-config.xml 


Th

Tomcat 4.0/Struts/Web.xml Question

2001-10-01 Thread Carl Sziebert








Hey all,

 

I have an issue that has probably been addressed previously, however, I can’t find any references to it
in the archive.  I recently installed
Catalina (Tomcat 4) and installed a webapp that works
on Tomcat 3.2.  I am receiving the
following error (included below) on startup of Catalina.  I have placed both the most recent versions
of the DOM and SAX parsers in %CATALINA_HOME%\lib, and I am still receiving the
error.  It apprears
that it is complaining about the web.xml file for the
webapp that I installed.  As far as I can tell it is the standard web.xml file that is provided with standard Struts
application.  I have included the error
below and have attached the web.xml for your
review.  It is probably something simple
that I have missed.  

 

-

 

PARSE error at line 38 column -1

org.xml.sax.SAXParseException:
Element "web-app" does not allow "servlet"
here.

 

-

 

Thanks to you all for you help.

 

Carl

 









http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>



  
  
index.jsp
  

  

  
  
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
  

  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  

  
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
  

  
  
action
org.apache.struts.action.ActionServlet

  application
  ApplicationResources


  config
  /WEB-INF/struts-config.xml


  debug
  2


  detail
  2


  validate
  true

2
 
 
   
  
action
*.do
  




RE: Tomcat 4.0/Struts/Web.xml Question

2001-10-01 Thread Domingo Aguilera



Place 
all related to servlet element at first place in 
web.xml,
that 
is right after 
 
-Mensaje original-De: Carl Sziebert 
[mailto:[EMAIL PROTECTED]]Enviado el: Lunes, 01 de 
Octubre de 2001 01:47 p.m.Para: 
[EMAIL PROTECTED]Asunto: Tomcat 4.0/Struts/Web.xml 
Question

Hey 
all,
 
I have an issue that has probably 
been addressed previously, however, I can’t find any 
references to it in the archive.  I 
recently installed Catalina (Tomcat 4) and installed a webapp that works on Tomcat 3.2.  I am receiving the following error 
(included below) on startup of Catalina.  
I have placed both the most recent versions of the DOM and SAX parsers in 
%CATALINA_HOME%\lib, and I am still receiving the error.  It apprears 
that it is complaining about the web.xml file for the 
webapp that I installed.  As far as I can tell it is the standard 
web.xml file that is provided with standard Struts 
application.  I have included the 
error below and have attached the web.xml for your 
review.  It is probably something 
simple that I have missed.  

 
-
 
PARSE error at line 38 column 
-1
org.xml.sax.SAXParseException: 
Element "web-app" does not allow "servlet" 
here.
 
-
 
Thanks to you all for you 
help.
 
Carl
 


Re: Support of Struts in IBM Websphere 4.0

2001-10-01 Thread Scott Ryan

Thanks.  We will give it another try.

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 10/01/01 11:39AM >>>
Scott,

I and a number of others are already using Struts (1.0) in WAS 4.0.0
and it 
works fine.

Here to help,
Stephen :-{)

Stephen Brand
Software Architect
[EMAIL PROTECTED] 




getting the servlet context

2001-10-01 Thread Johnson, Nathaniel

Does anyone know how to get the servletContext from within a custom tag
(public class MyTag extends SupportTag...)

Thanks!
Nate







RE: Support of Struts in IBM Websphere 4.0

2001-10-01 Thread Assenza, Chris

Make sure you use the modified struts jar from
http://www.enfused.com/struts.jar

Chris

Christopher Assenza
Phone:  412.201.6026
Fax: 412.201.6060
Email:  [EMAIL PROTECTED]
ACCESSDATA
Moving Your Business from Point A to Point e.SM
http://www.accessdc.com/



-Original Message-
From: Scott Ryan [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 3:48 PM
To: [EMAIL PROTECTED]
Subject: Re: Support of Struts in IBM Websphere 4.0


Thanks.  We will give it another try.

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 10/01/01 11:39AM >>>
Scott,

I and a number of others are already using Struts (1.0) in WAS 4.0.0
and it 
works fine.

Here to help,
Stephen :-{)

Stephen Brand
Software Architect
[EMAIL PROTECTED] 



Re: getting the servlet context

2001-10-01 Thread Peter Alfors

try

  pageContext.getServletContext()

HTH,
Pete

"Johnson, Nathaniel" wrote:

> Does anyone know how to get the servletContext from within a custom tag
> (public class MyTag extends SupportTag...)
>
> Thanks!
> Nate


begin:vcard 
n:;
x-mozilla-html:FALSE
org:http://www.irista.com/images/common/logo_top_right.gif";>
adr:;;
version:2.1
end:vcard



Antigen found =*.vcf file

2001-10-01 Thread ANTIGEN_MG01

Antigen for Exchange found peter.alfors.vcf matching =*.vcf file filter.
The file is currently Deleted.  The message, "Re: getting the servlet
context", was
sent from Peter Alfors  and was discovered in IMC Queues\Inbound
located at IBC/PA1/MG01.
DISCLAIMER



AW: getting the servlet context

2001-10-01 Thread Thomas Schnelle

Try this
ServletContext con = pageContext.getServletContext();
regards
Thomas

-Ursprüngliche Nachricht-
Von: Johnson, Nathaniel [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 1. Oktober 2001 21:49
An: '[EMAIL PROTECTED]'
Betreff: getting the servlet context


Does anyone know how to get the servletContext from within a custom tag
(public class MyTag extends SupportTag...)

Thanks!
Nate







RE: getting the servlet context

2001-10-01 Thread Johnson, Nathaniel

I have tried that and it fails... when I debug, it says that pageContext is
returning null.  Is there something that I have to do to enable page context
in the tag class or the jsp using the tag?

-Original Message-
From: Peter Alfors [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 2:49 PM
To: [EMAIL PROTECTED]
Subject: Re: getting the servlet context


try

  pageContext.getServletContext()

HTH,
Pete

"Johnson, Nathaniel" wrote:

> Does anyone know how to get the servletContext from within a custom tag
> (public class MyTag extends SupportTag...)
>
> Thanks!
> Nate



Re: getting the servlet context

2001-10-01 Thread Manuel Berney

"Johnson, Nathaniel" a écrit :
> 
> Does anyone know how to get the servletContext from within a custom tag
> (public class MyTag extends SupportTag...)
> 
> Thanks!
> Nate

i did it that way seems to work

ActionMappings mappings =
(ActionMappings)pageContext.getAttribute(Action.MAPPINGS_KEY,PageContext.APPLICATION_SCOPE);
ServletContext context = mappings.getServlet().getServletContext();



RE: getting the servlet context

2001-10-01 Thread Johnson, Nathaniel

I got it to work... thanks to all... the problem was that I was trying to
get the pageContext in the tags constructor and I guess in is not available
until the doStartTag() method.  I am new the this environment.

-Original Message-
From: Thomas Schnelle [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 3:00 PM
To: [EMAIL PROTECTED]
Subject: AW: getting the servlet context


Try this
ServletContext con = pageContext.getServletContext();
regards
Thomas

-Ursprüngliche Nachricht-
Von: Johnson, Nathaniel [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 1. Oktober 2001 21:49
An: '[EMAIL PROTECTED]'
Betreff: getting the servlet context


Does anyone know how to get the servletContext from within a custom tag
(public class MyTag extends SupportTag...)

Thanks!
Nate






Re: getting the servlet context

2001-10-01 Thread Luis Olivares

 ServletContext application = pageContext.getServletContext();

Regards.
   Luis Olivares.
   [EMAIL PROTECTED]
   --
  "Intelligence is the ability to avoid doing
   work, yet getting the work done"
  --Linus Torvalds--

- Original Message - 
From: "Johnson, Nathaniel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 2:49 PM
Subject: getting the servlet context


> Does anyone know how to get the servletContext from within a custom tag
> (public class MyTag extends SupportTag...)
> 
> Thanks!
> Nate
> 
> 
> 




Form Validation Question

2001-10-01 Thread DEHAMER,BRIAN (HP-MountainView,ex1)

If I want to use form validation with my ActionForm bean, what should I
specify for the "input" attribute of my action defition?  Should it
reference the JSP page that renders the form (e.g. "/login.jsp") or should
it reference the action responsible for presenting the form (e.g.
"/login.do")?

All of the examples that I've seen show the "input" attribute pointing to
the JSP page; however, when I do this I notice that my page doesn't render
properly because it is dependent on some information that is set in the
associated action class.  If I put an action path in the "input" attribute I
think I can solve my problem, but I'm not sure if this is an appropriate use
of the architecture.  

Thanks for the help.

Brian DeHamer
Hewlett-Packard Co.
[EMAIL PROTECTED]



RE: Support of Struts in IBM Websphere 4.0

2001-10-01 Thread Scott Ryan

Chris,
Now I am confused.  I am trying to get away from having to use a
modified struts jar.  The reason the jar needs to be modified is because
IBM has a problem with their implementation of Jasper.  I saw in an
email on this forum that IBM had comitted to fix this problem but did
not commit to a timeframe.  I would like to be able to use the latest
struts build without having to modify the code because the modification
causes other problems.

Thanks for your feedback

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 10/01/01 01:45PM >>>
Make sure you use the modified struts jar from
http://www.enfused.com/struts.jar 

Chris

Christopher Assenza
Phone:  412.201.6026
Fax: 412.201.6060
Email:  [EMAIL PROTECTED] 
ACCESSDATA
Moving Your Business from Point A to Point e.SM
http://www.accessdc.com/ 



-Original Message-
From: Scott Ryan [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 01, 2001 3:48 PM
To: [EMAIL PROTECTED] 
Subject: Re: Support of Struts in IBM Websphere 4.0


Thanks.  We will give it another try.

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 10/01/01 11:39AM >>>
Scott,

I and a number of others are already using Struts (1.0) in WAS 4.0.0
and it 
works fine.

Here to help,
Stephen :-{)

Stephen Brand
Software Architect
[EMAIL PROTECTED] 



HELP! Problems with SSL (HTTPS) on WebLogic 6.1

2001-10-01 Thread Eric Wu

I have been trying to get a struts application to switch between HTTP and
HTTPS using the approach Ted and Craig have suggested in the past
(http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg07841.html)

I am using WebLogic 6.1 with IIS 4 as the web server.  It appears that the
problem is that the URL generated by Struts has the format
http://mysite/mypage;jsessionid=aabbcc12345  It appears that it is the
;jsessionid= part that confuses IIS and also WebLogic's iisforward.dll for
forwarding by path.

Has anybody been able to get a similar configuration working?

Thanks!

Eric Wu  
Java Architect   
GlobalMedic Inc., a Canadian Medical Association subsidiary

8200 Decarie Blvd., Suite 205
Montreal, Qc.
Canada, H4P 2P5
Tel: (514) 738-6770 Ext. 239
Fax: (514) 738-4827
Email: [EMAIL PROTECTED] 
Web:  
Gold Medal Winner at the 2000 WWW Health Awards





RE: New professional STRUTS website

2001-10-01 Thread Strichartz, Beth


Love the site!
-Original Message-
From: Frederick N. Brier [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 30, 2001 11:36 AM
To: [EMAIL PROTECTED]
Subject: Re: New professional STRUTS website


Beautiful site!  I haven't been through it all yet, but a very impressive 
web application.  As Martin Cooper asked, I would also be interested in 
what aspects of Struts you found most useful, what you felt was missing, 
whether you did one large page or tiled, etc.  I am curious how you 
implemented shared functionality such as uploading of images or their 
editing.  Did you duplicate the actions, somehow parameterize your JSPs, 
etc? Thank you for sharing your site.

Frederick N. Brier

At 11:48 AM 9/29/2001, you wrote:
>www.hallmarkstories.com
>
>Please have a look at this new site developed to produce offline physcial 
>product through an online web based application for Hallmark, Inc. by iXL, 
>Inc.(NYC).  I would be happy to provide more detail into any questions 
>anyone may have in terms of the STRUTS implimentation or other solutions 
>for the build.  I have been reading this list for a long time and working 
>on this project for a very long time hoping to expose STRUTS as a 
>fantastic framework for implimenting proffessional MVC based web
applications.
>
>Thanks,
>Adam S. Grohs
>[EMAIL PROTECTED]


This message contains information which may be confidential and privileged.
Unless you are the addressee  (or authorized to receive for the addressee),
you may not use, copy or disclose to anyone the message or any information
contained in the message.  If you have received the message in error, please
advise the sender by reply e-mail, and delete or destroy the message. 

Thank you.




RE: Support of Struts in IBM Websphere 4.0

2001-10-01 Thread Assenza, Chris

Well that's your call. The changes to the form tag are very minor at best,
and I don't really see the them having any significant negative impact for
most projects, but yours may be that unfortunate exception.  

If it makes you uneasy or annoyed (which the later does me), then I
recommend contacting IBM and getting on their case...repeatedly. ;) 

Best,

Chris

Christopher Assenza
Phone:  412.201.6026
Fax: 412.201.6060
Email:  [EMAIL PROTECTED]
ACCESSDATA
Moving Your Business from Point A to Point e.SM
http://www.accessdc.com/



-Original Message-
From: Scott Ryan [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 4:52 PM
To: [EMAIL PROTECTED]
Subject: RE: Support of Struts in IBM Websphere 4.0


Chris,
Now I am confused.  I am trying to get away from having to use a
modified struts jar.  The reason the jar needs to be modified is because
IBM has a problem with their implementation of Jasper.  I saw in an
email on this forum that IBM had comitted to fix this problem but did
not commit to a timeframe.  I would like to be able to use the latest
struts build without having to modify the code because the modification
causes other problems.

Thanks for your feedback

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 10/01/01 01:45PM >>>
Make sure you use the modified struts jar from
http://www.enfused.com/struts.jar 

Chris

Christopher Assenza
Phone:  412.201.6026
Fax: 412.201.6060
Email:  [EMAIL PROTECTED] 
ACCESSDATA
Moving Your Business from Point A to Point e.SM
http://www.accessdc.com/ 



-Original Message-
From: Scott Ryan [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 01, 2001 3:48 PM
To: [EMAIL PROTECTED] 
Subject: Re: Support of Struts in IBM Websphere 4.0


Thanks.  We will give it another try.

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 10/01/01 11:39AM >>>
Scott,

I and a number of others are already using Struts (1.0) in WAS 4.0.0
and it 
works fine.

Here to help,
Stephen :-{)

Stephen Brand
Software Architect
[EMAIL PROTECTED] 



Re: New professional STRUTS website

2001-10-01 Thread Marcelo Vanzin

Strichartz, Beth wrote:

> Love the site!

Except for the Javascript popup in every page I visit saying that "My 
browser/OS is not supported!", it looks fine. :-)



-- 
[]'s
Marcelo Vanzin
Touch Tecnologia
[EMAIL PROTECTED]
"We're an underground revolution working overtime"




Re: Form Validation Question

2001-10-01 Thread David Winterfeldt

You can put in any url in the input attribute.  So
there isn't a problem having input go through an
action.

David

--- "DEHAMER,BRIAN (HP-MountainView,ex1)"
<[EMAIL PROTECTED]> wrote:
> If I want to use form validation with my ActionForm
> bean, what should I
> specify for the "input" attribute of my action
> defition?  Should it
> reference the JSP page that renders the form (e.g.
> "/login.jsp") or should
> it reference the action responsible for presenting
> the form (e.g.
> "/login.do")?
> 
> All of the examples that I've seen show the "input"
> attribute pointing to
> the JSP page; however, when I do this I notice that
> my page doesn't render
> properly because it is dependent on some information
> that is set in the
> associated action class.  If I put an action path in
> the "input" attribute I
> think I can solve my problem, but I'm not sure if
> this is an appropriate use
> of the architecture.  
> 
> Thanks for the help.
> 
> Brian DeHamer
> Hewlett-Packard Co.
> [EMAIL PROTECTED]


__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com



Configuring Struts with Tomcat and Apache

2001-10-01 Thread tnist

I am a new-bie to Struts and have just installed 1.0 with Tomcat 3.2.2 and
Apache.  I followed the instructions in the installations
(tomcat-apache.conf). But when trying to run an example like struts-example,
I am encountering the below error. In the documentation there is a
description for tomcat-apache.conf to add an ADDHANDLER *.do after the
"corresponding line for the .jsp extension), but I am using mod_jk under
Window 2000 and therefore mod_jk.conf; so I would guess that I need to add
an entry to the mod_jk.conf file, but where?  I have modified my mod_jk.conf
file to include the line "JkMount /*.do ajp12" but it does not appear to be
carried over to the mod_jk.conf-auto created by tomcat.  What am I doing
wrong?

All suggestions are welcome.

Environment:
Windows 2000
Tomcat: 3.2.2
Apache: 1.3.14

Error: 500
Location: /struts-example/index.jsp
Internal Servlet Error:

javax.servlet.ServletException
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:166)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

Root cause: 
java.lang.NoSuchMethodError
at
org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfo
Impl.java:524)
at
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoIm
pl.java:432)
at
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.ja
va:385)
at
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:233)
at
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve
ntListener.java:706)
at
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList
ener.java:116)
at
org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:182)
at
org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:152)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:164)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:166)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)


Regards,

Todd G. Nist 
[EMAIL PROTECTED]


The information in this electronic mail ("e-mail") message may
be confidential and for use of only the named recipient.  The
information may be protected by privilege, work product immunity
or other applicable law.  If you are not the intended recipient
the retention, dissemination, distribution or copying of this
e-mail message is strictly prohibited.  If you receive this e-mail
message in error please notify us immediately by telephone
at 770-723-1011 or [EMAIL PROTECTED]  Thank you. 





Re: Support of Struts in IBM Websphere 4.0

2001-10-01 Thread SLBrand
Scott,

I have to agree with Chris on this one... the 2 line change in one method is extremely minor for all the benefit (you get to use struts :).  I further agree that if you want IBM's action... to contact IBM directly. On the plus side... in my direct experience with IBM, then have been pretty good in providing e-fix's/patches when it is their problem.

Here to help,
Stephen :-{)

Stephen Brand
Software Architect
[EMAIL PROTECTED]


RE: New professional STRUTS website

2001-10-01 Thread Thinh Doan



For me 
I'm curious if you use html:errors (ActionErrors) at all?  More 
specifically, how did you pop up the singin error on another window instead of 
on the same window if html:errors were used?
 
Nice 
site, thanks for sharing.
 
Thinh

  -Original Message-From: Adam Grohs 
  [mailto:[EMAIL PROTECTED]]Sent: Saturday, September 29, 2001 
  10:48 AMTo: [EMAIL PROTECTED]Subject: New 
  professional STRUTS website
  www.hallmarkstories.com
   
  Please have a look at this new site developed to 
  produce offline physcial product through an online web based application for 
  Hallmark, Inc. by iXL, Inc.(NYC).  I would be happy to provide more 
  detail into any questions anyone may have in terms of the STRUTS 
  implimentation or other solutions for the build.  I have been 
  reading this list for a long time and working on this project for a very 
  long time hoping to expose STRUTS as a fantastic framework for implimenting 
  proffessional MVC based web applications.
   
  Thanks,
  Adam S. Grohs
  [EMAIL PROTECTED]


Exceptions in Sample Application !

2001-10-01 Thread Rajendra kadam

Hello Experts,
 I'm using Tomcat3.2.1 and struts 1.0
 When I try to Access the JSP from browser got following ServletException :-
 "Cannot find ActionMappings or ActionFormBeans collection"

 I have my struts-config.xml in which action-mapping has been declared.
 Here I'm attaching my web.xml and struts-config.xml

 Please help in solving the problem.
 thanks,
 raju







http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>




  
  


  


  
  



  


  
  








  





http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>




  


  
  
action
org.apache.struts.action.ActionServlet

  application
  ApplicationResources


  config
  /WEB-INF/struts-config.xml


  debug
  2


  detail
  2


  validate
  true

2
  


  
  
action
*.do
  


  
  
logon.jsp
  

  

  
  
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
  

  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  

  
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
  





deep nesting of value objects in a form bean

2001-10-01 Thread David Boardman

I am looking for some confirmation of the approach I have taken in
developing an ActionForm that represents an Entity bean hierarchy that nests
several beans deep.

I have a form bean that I use to update a Candidate entity bean.  The
Candidate bean has an Address entity bean associated with it, and the
Address bean contains both a Country entity bean and a State entity bean.  I
have created ValueObjects for each of these entity beans so that, for
instance, I can call CandidateVO.getAddress().getState().getCode() to
retrieve the state code.  With the ValueObjects nested in this way I can
simply call the setCandidateVO() on the ActionForm and use nested properties
in my jsp to interact with the ActionForm.  For instance, if the following
field were in the jsp, then
getCandidateVO().getAddress().getState().setCode() would be called when the
form is submitted:



I have then planned on writting updateVO() methods on each of the entity
beans that would be used to update the beans from the newly updated
ValueObjects.

I have 2 questions about this scenario:

1)From what I ahve read, ValueObjects are supposed to be immutable, however,
in the scenario above they clearly are not.  Is there a way to accomplish
the above scenario without making the ValueObjects mutable.

2)If one of the attributes of one of my entity beans is not a String, is
there still a way to use nested properties to set that attribute?  Or do I
need to create a method that does the type conversion in the ActionForm, and
then populate the ValueObject back in my Action class?

thanks,

Dave




RE: AND/OR with logic tags

2001-10-01 Thread Niall Pemberton

I have a set of tags based on If that includes AND/OR, which can be
downloaded from Ted husted's site (reference is shown under "Contributor
Taglib on the strust site):

  http://jakarta.apache.org/struts/userGuide/resources.html
  http://husted.com/about/struts/logic-niallp.htm


However this was recently discussed on the Dev list and 9 out of 10
committers (well 3 actually - Craig McClanahan, Martin Cooper, Ted Husted)
preferred the JSPTL route than this.

I include links to that thread below:

http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02946.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02947.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02959.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02960.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02962.html


Niall

> -Original Message-
> From: Eric Rizzo [mailto:[EMAIL PROTECTED]]
> Sent: 01 October 2001 17:06
> To: [EMAIL PROTECTED]
> Subject: AND/OR with logic tags
>
>
> Sorry if this has already been asked/answered here - the mail
> archive doesn't
> let me search for "AND OR".
>
> Is there a way to have multiple conditional logic with the Struts
> logic taglib?
>   For example, "IF (user is present) OR (visitor equals true)".
>
> TIA,
>   Eric
> --
> Eric Rizzo, Software Engineer
> OpenNetwork Technologies
> http://www.opennetwork.com
> -
> I embrace my personality flaws, for without them
> I might have no personality at all.
>




RE: Tomcat 4.0 and Struts.

2001-10-01 Thread Brett Porter
Title: RE: Tomcat 4.0 and Struts.





I had the same problem. I removed jaxp.jar from the tomcat lib directory, as it seemed to be conflicting with Xerces. Removing Xerces from the classpath also works, but I use another library that depends on it.

Cheers,
Brett


-Original Message-
From: Domingo Aguilera [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 2 October 2001 3:52 AM
To: [EMAIL PROTECTED]
Subject: RE: Tomcat 4.0 and Struts.



I made a mistake when writing about the location of the xml parser...


It is Xerces 1.4.1 and is placed in $TOMCAT/webapps/myapp/WEB-INF/lib


-Mensaje original-
De: Domingo Aguilera [mailto:[EMAIL PROTECTED]]
Enviado el: Lunes, 01 de Octubre de 2001 12:47 p.m.
Para: [EMAIL PROTECTED]
Asunto: Tomcat 4.0 and Struts.



Is there any issue regarding the use of Tomcat 4.0 and struts when dealing
with the "digester parsing" of the struts-config.xml ?


This is what´s been written to log file in tomcat 4.0


2001-10-01 11:28:58 StandardContext[/extranet]: Servlet /extranet threw
load() exception
javax.servlet.ServletException: Servlet.init() for servlet action threw
exception
    at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
    at org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)
    at org.apache.catalina.core.StandardContext.start(Unknown Source)
    at org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
    at org.apache.catalina.core.StandardHost.addChild(Unknown Source)
    at org.apache.catalina.core.StandardHost.install(Unknown Source)
    at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
    at org.apache.catalina.startup.HostConfig.start(Unknown Source)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown
Source)
    at org.apache.catalina.core.ContainerBase.start(Unknown Source)
    at org.apache.catalina.core.ContainerBase.start(Unknown Source)
    at org.apache.catalina.core.StandardEngine.start(Unknown Source)
    at org.apache.catalina.core.StandardService.start(Unknown Source)
    at org.apache.catalina.core.StandardServer.start(Unknown Source)
    at org.apache.catalina.startup.Catalina.start(Unknown Source)
    at org.apache.catalina.startup.Catalina.execute(Unknown Source)
    at org.apache.catalina.startup.Catalina.process(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42
)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:28)
    at java.lang.reflect.Method.invoke(Method.java:313)
    at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
- Root Cause -
java.lang.NullPointerException
    at org.apache.commons.digester.Digester.parse(Digester.java:859)
    at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1273)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:460)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
    at org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)
    at org.apache.catalina.core.StandardContext.start(Unknown Source)
    at org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
    at org.apache.catalina.core.StandardHost.addChild(Unknown Source)
    at org.apache.catalina.core.StandardHost.install(Unknown Source)
    at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
    at org.apache.catalina.startup.HostConfig.start(Unknown Source)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown
Source)
    at org.apache.catalina.core.ContainerBase.start(Unknown Source)
    at org.apache.catalina.core.ContainerBase.start(Unknown Source)
    at org.apache.catalina.core.StandardEngine.start(Unknown Source)
    at org.apache.catalina.core.StandardService.start(Unknown Source)
    at org.apache.catalina.core.StandardServer.start(Unknown Source)
    at org.apache.catalina.startup.Catalina.start(Unknown Source)
    at org.apache.catalina.startup.Catalina.execute(Unknown Source)
    at org.apache.catalina.startup.Catalina.process(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42
)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:28)
    at java.lang.reflect.Method.invoke(Method.java:313)
    at org.apache.catalina.startup.Bootstrap.main(Unknown Source)


This is the struts-config.xml (

RE: deep nesting of value objects in a form bean

2001-10-01 Thread Matthew O'Haire
Title: RE: deep nesting of value objects in a form bean





I've sucessfully used a VO structure in a struts app and
used dot notation to access the data in just the way you
describe.  However, in our case the VO's were immutable.


O.K., now for my 2c worth...


I'd be very careful using "generic" update methods like
updateVO() to process business logic.  Say you have an
object with some state and you need to perform a state
transtion (A->B) you could do this by changing the state
value, or by calling a method that describes the state
transtion (i.e. startEngine()).  If you simply change
the data, the "business logic" for allowable transitions
is in your client code... and the situation can only get
worse as more and more data values change.  For example,
say a transition requires an associated date, now you need
to change two values in combination (see how the business
logic creeps down to your client) rather than using a method
(i.e. cancelOrder(Date cancelDate)).  If you opt for an API
to encapsulate the business operations on your Entities then
you'll have a much cleaner interface, you'll be able to see
the business operations supported by the API and you'll
achive greater seperation of business/presenattion logic.
Some patterns to consider for this are Session Facade and
Business Delegate.





RE: deep nesting of value objects in a form bean

2001-10-01 Thread Matthew O'Haire
Title: RE: deep nesting of value objects in a form bean



for 
anyone interested.. here's the URL to the project...
http://www.tstrata.trysoft.com 
 
it's 
an extranet app, so there isn't too much facinating stuff to look 
at.  ;-)
 

  -Original Message-From: Matthew O'Haire 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, October 02, 2001 
  10:12To: '[EMAIL PROTECTED]'Subject: RE: 
  deep nesting of value objects in a form bean
  I've sucessfully used a VO structure in a struts app 
  and used dot notation to access the data in just the 
  way you describe.  However, in our case the VO's 
  were immutable. 
  O.K., now for my 2c worth... 
  I'd be very careful using "generic" update methods like 
  updateVO() to process business logic.  Say you have 
  an object with some state and you need to perform a 
  state transtion (A->B) you could do this by 
  changing the state value, or by calling a method that 
  describes the state transtion (i.e. 
  startEngine()).  If you simply change the data, 
  the "business logic" for allowable transitions is in 
  your client code... and the situation can only get worse as more and more data values change.  For example, 
  say a transition requires an associated date, now you 
  need to change two values in combination (see how the 
  business logic creeps down to your client) rather than 
  using a method (i.e. cancelOrder(Date 
  cancelDate)).  If you opt for an API to 
  encapsulate the business operations on your Entities then you'll have a much cleaner interface, you'll be able to see 
  the business operations supported by the API and 
  you'll achive greater seperation of 
  business/presenattion logic. Some patterns to consider 
  for this are Session Facade and Business 
  Delegate. 


RE: Tomcat 4.0 and Struts.

2001-10-01 Thread Domingo Aguilera
Title: RE: Tomcat 4.0 and Struts.



There 
is no jaxp.jar in $TOMCAT/lib but these files:
 
jasper-runtime.jar
naming-factory.jar
 
In 
$TOMCAT/commons/lib are the crimson files:
 
crimson.jar and jaxp.jar , but don't know if you are talking about these 
files.
 
Thanks.
 
-Mensaje original-De: Brett Porter 
[mailto:[EMAIL PROTECTED]]Enviado el: Lunes, 01 de Octubre de 
2001 07:06 p.m.Para: 
'[EMAIL PROTECTED]'Asunto: RE: Tomcat 4.0 and 
Struts.
I had the same problem. I removed jaxp.jar from the tomcat lib 
directory, as it seemed to be conflicting with Xerces. Removing Xerces from the 
classpath also works, but I use another library that depends on it.
Cheers, Brett 
-Original Message- From: Domingo 
Aguilera [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 2 October 2001 3:52 AM To: [EMAIL PROTECTED] Subject: RE: 
Tomcat 4.0 and Struts. 
I made a mistake when writing about the location of the xml 
parser... 
It is Xerces 1.4.1 and is placed in 
$TOMCAT/webapps/myapp/WEB-INF/lib 
-Mensaje original- De: Domingo 
Aguilera [mailto:[EMAIL PROTECTED]] 
Enviado el: Lunes, 01 de Octubre de 2001 12:47 p.m. 
Para: [EMAIL PROTECTED] Asunto: Tomcat 4.0 and Struts. 
Is there any issue regarding the use of Tomcat 4.0 and struts 
when dealing with the "digester parsing" of the 
struts-config.xml ? 
This is what´s been written to log file in tomcat 4.0 

2001-10-01 11:28:58 StandardContext[/extranet]: Servlet 
/extranet threw load() exception javax.servlet.ServletException: Servlet.init() for servlet action 
threw exception 
    at 
org.apache.catalina.core.StandardWrapper.load(Unknown Source) 
    at 
org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source) 
    at 
org.apache.catalina.core.StandardContext.start(Unknown Source) 
    at 
org.apache.catalina.core.ContainerBase.addChild(Unknown Source) 
    at 
org.apache.catalina.core.StandardHost.addChild(Unknown Source) 
    at 
org.apache.catalina.core.StandardHost.install(Unknown Source) 
    at 
org.apache.catalina.startup.HostConfig.deployApps(Unknown Source) 
    at 
org.apache.catalina.startup.HostConfig.start(Unknown Source) 
    at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source) 
    at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown 
Source)     
at org.apache.catalina.core.ContainerBase.start(Unknown 
Source)     at 
org.apache.catalina.core.ContainerBase.start(Unknown Source) 
    at 
org.apache.catalina.core.StandardEngine.start(Unknown Source) 
    at 
org.apache.catalina.core.StandardService.start(Unknown Source) 
    at 
org.apache.catalina.core.StandardServer.start(Unknown Source) 
    at 
org.apache.catalina.startup.Catalina.start(Unknown Source) 
    at 
org.apache.catalina.startup.Catalina.execute(Unknown Source) 
    at 
org.apache.catalina.startup.Catalina.process(Unknown Source) 
    at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42 
)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl 
.java:28)     
at java.lang.reflect.Method.invoke(Method.java:313) 
    at 
org.apache.catalina.startup.Bootstrap.main(Unknown Source) - Root Cause - java.lang.NullPointerException 
    at 
org.apache.commons.digester.Digester.parse(Digester.java:859) 
    at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1273) 
    at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:460) 
    at 
javax.servlet.GenericServlet.init(GenericServlet.java:258) 
    at 
org.apache.catalina.core.StandardWrapper.load(Unknown Source) 
    at 
org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source) 
    at 
org.apache.catalina.core.StandardContext.start(Unknown Source) 
    at 
org.apache.catalina.core.ContainerBase.addChild(Unknown Source) 
    at 
org.apache.catalina.core.StandardHost.addChild(Unknown Source) 
    at 
org.apache.catalina.core.StandardHost.install(Unknown Source) 
    at 
org.apache.catalina.startup.HostConfig.deployApps(Unknown Source) 
    at 
org.apache.catalina.startup.HostConfig.start(Unknown Source) 
    at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source) 
    at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown 
Source)     
at org.apache.catalina.core.ContainerBase.start(Unknown 
Source)     at 
org.apache.catalina.core.ContainerBase.start(Unknown Source) 
    at 
org.apache.catalina.core.StandardEngine.start(Unknown Source) 
    at 
org.apache.catalina.core.StandardService.start(Unknown Source) 
    at 
org.apache.catalina.core.StandardServer.start(Unknown Source) 
    at 
org.apache.catalina.startup.Catalina.start(Unknown Source) 
    at 
org.apache.catalina.startup.Catalina.execute(

RE: Tomcat 4.0 and Struts.

2001-10-01 Thread Brett Porter
Title: RE: Tomcat 4.0 and Struts.



yep, 
sorry. $CATALINA_HOME/common/lib/jaxp.jar was the one I renamed. This may or may 
not be the best solution, but I haven't encountered any problems so far. AFAIK 
Xerces contains all the classes supplied by JAXP, but not 
vice-versa.
 
Cheers,
Brett

  -Original Message-From: Domingo Aguilera 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, 2 October 
  2001 9:24 AMTo: [EMAIL PROTECTED]Subject: 
  RE: Tomcat 4.0 and Struts.
  There is no jaxp.jar in $TOMCAT/lib but these 
files:
   
  jasper-runtime.jar
  naming-factory.jar
   
  In 
  $TOMCAT/commons/lib are the crimson files:
   
  crimson.jar and jaxp.jar , but don't know if you are talking about 
  these files.
   
  Thanks.
   
  -Mensaje original-De: Brett Porter 
  [mailto:[EMAIL PROTECTED]]Enviado el: Lunes, 01 de Octubre 
  de 2001 07:06 p.m.Para: 
  '[EMAIL PROTECTED]'Asunto: RE: Tomcat 4.0 and 
  Struts.
  I had the same problem. I removed jaxp.jar from the tomcat lib 
  directory, as it seemed to be conflicting with Xerces. Removing Xerces from 
  the classpath also works, but I use another library that depends on 
  it.
  Cheers, Brett 
  -Original Message- From: 
  Domingo Aguilera [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, 2 October 2001 3:52 AM To: [EMAIL PROTECTED] Subject: RE: 
  Tomcat 4.0 and Struts. 
  I made a mistake when writing about the location of the xml 
  parser... 
  It is Xerces 1.4.1 and is placed in 
  $TOMCAT/webapps/myapp/WEB-INF/lib 
  -Mensaje original- De: Domingo 
  Aguilera [mailto:[EMAIL PROTECTED]] 
  Enviado el: Lunes, 01 de Octubre de 2001 12:47 p.m. 
  Para: [EMAIL PROTECTED] Asunto: Tomcat 4.0 and Struts. 
  Is there any issue regarding the use of Tomcat 4.0 and struts 
  when dealing with the "digester parsing" of the 
  struts-config.xml ? 
  This is what´s been written to log file in tomcat 4.0 
  
  2001-10-01 11:28:58 StandardContext[/extranet]: Servlet 
  /extranet threw load() exception javax.servlet.ServletException: Servlet.init() for servlet action 
  threw exception 
      at 
  org.apache.catalina.core.StandardWrapper.load(Unknown Source) 
      at 
  org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source) 
      at 
  org.apache.catalina.core.StandardContext.start(Unknown Source) 
      at 
  org.apache.catalina.core.ContainerBase.addChild(Unknown Source) 
      at 
  org.apache.catalina.core.StandardHost.addChild(Unknown Source) 
      at 
  org.apache.catalina.core.StandardHost.install(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.deployApps(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.start(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source) 
      at 
  org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown 
  Source)     
  at org.apache.catalina.core.ContainerBase.start(Unknown 
  Source)     at 
  org.apache.catalina.core.ContainerBase.start(Unknown Source) 
      at 
  org.apache.catalina.core.StandardEngine.start(Unknown Source) 
      at 
  org.apache.catalina.core.StandardService.start(Unknown Source) 
      at 
  org.apache.catalina.core.StandardServer.start(Unknown Source) 
      at 
  org.apache.catalina.startup.Catalina.start(Unknown Source) 
      at 
  org.apache.catalina.startup.Catalina.execute(Unknown Source) 
      at 
  org.apache.catalina.startup.Catalina.process(Unknown Source) 
      at 
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
      at 
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42 
  )     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl 
  .java:28) 
      at 
  java.lang.reflect.Method.invoke(Method.java:313) 
      at 
  org.apache.catalina.startup.Bootstrap.main(Unknown Source) - Root Cause - java.lang.NullPointerException 
      at 
  org.apache.commons.digester.Digester.parse(Digester.java:859) 
      at 
  org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1273) 
      at 
  org.apache.struts.action.ActionServlet.init(ActionServlet.java:460) 
      at 
  javax.servlet.GenericServlet.init(GenericServlet.java:258) 
      at 
  org.apache.catalina.core.StandardWrapper.load(Unknown Source) 
      at 
  org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source) 
      at 
  org.apache.catalina.core.StandardContext.start(Unknown Source) 
      at 
  org.apache.catalina.core.ContainerBase.addChild(Unknown Source) 
      at 
  org.apache.catalina.core.StandardHost.addChild(Unknown Source) 
      at 
  org.apache.catalina.core.StandardHost.install(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.deployApps(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.start(Unknown Source) 
      

Forward To Another Action

2001-10-01 Thread Jeff Gutierrez


Hey guys,

Quick question.. can an action forward to another action?  If so, how can 
I do it?

Thanks,

jeff --

-- 
Jeff Gutierrez
Mapua Online! 
http://www.mapua.org
http://www.mapua.com
http://www.mapua.net

Pinoy Ako! May reklamo?




RE: Tomcat 4.0 and Struts.

2001-10-01 Thread Brett Porter
Title: RE: Tomcat 4.0 and Struts.



That 
was really bad advice - please forget I said it.
 
While 
it worked for me at home, it won't work here.
 
I'll 
continue to look into it, and let you know.
 
Cheers,
Brett

  -Original Message-From: Domingo Aguilera 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, 2 October 
  2001 9:24 AMTo: [EMAIL PROTECTED]Subject: 
  RE: Tomcat 4.0 and Struts.
  There is no jaxp.jar in $TOMCAT/lib but these 
files:
   
  jasper-runtime.jar
  naming-factory.jar
   
  In 
  $TOMCAT/commons/lib are the crimson files:
   
  crimson.jar and jaxp.jar , but don't know if you are talking about 
  these files.
   
  Thanks.
   
  -Mensaje original-De: Brett Porter 
  [mailto:[EMAIL PROTECTED]]Enviado el: Lunes, 01 de Octubre 
  de 2001 07:06 p.m.Para: 
  '[EMAIL PROTECTED]'Asunto: RE: Tomcat 4.0 and 
  Struts.
  I had the same problem. I removed jaxp.jar from the tomcat lib 
  directory, as it seemed to be conflicting with Xerces. Removing Xerces from 
  the classpath also works, but I use another library that depends on 
  it.
  Cheers, Brett 
  -Original Message- From: 
  Domingo Aguilera [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, 2 October 2001 3:52 AM To: [EMAIL PROTECTED] Subject: RE: 
  Tomcat 4.0 and Struts. 
  I made a mistake when writing about the location of the xml 
  parser... 
  It is Xerces 1.4.1 and is placed in 
  $TOMCAT/webapps/myapp/WEB-INF/lib 
  -Mensaje original- De: Domingo 
  Aguilera [mailto:[EMAIL PROTECTED]] 
  Enviado el: Lunes, 01 de Octubre de 2001 12:47 p.m. 
  Para: [EMAIL PROTECTED] Asunto: Tomcat 4.0 and Struts. 
  Is there any issue regarding the use of Tomcat 4.0 and struts 
  when dealing with the "digester parsing" of the 
  struts-config.xml ? 
  This is what´s been written to log file in tomcat 4.0 
  
  2001-10-01 11:28:58 StandardContext[/extranet]: Servlet 
  /extranet threw load() exception javax.servlet.ServletException: Servlet.init() for servlet action 
  threw exception 
      at 
  org.apache.catalina.core.StandardWrapper.load(Unknown Source) 
      at 
  org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source) 
      at 
  org.apache.catalina.core.StandardContext.start(Unknown Source) 
      at 
  org.apache.catalina.core.ContainerBase.addChild(Unknown Source) 
      at 
  org.apache.catalina.core.StandardHost.addChild(Unknown Source) 
      at 
  org.apache.catalina.core.StandardHost.install(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.deployApps(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.start(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source) 
      at 
  org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown 
  Source)     
  at org.apache.catalina.core.ContainerBase.start(Unknown 
  Source)     at 
  org.apache.catalina.core.ContainerBase.start(Unknown Source) 
      at 
  org.apache.catalina.core.StandardEngine.start(Unknown Source) 
      at 
  org.apache.catalina.core.StandardService.start(Unknown Source) 
      at 
  org.apache.catalina.core.StandardServer.start(Unknown Source) 
      at 
  org.apache.catalina.startup.Catalina.start(Unknown Source) 
      at 
  org.apache.catalina.startup.Catalina.execute(Unknown Source) 
      at 
  org.apache.catalina.startup.Catalina.process(Unknown Source) 
      at 
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
      at 
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42 
  )     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl 
  .java:28) 
      at 
  java.lang.reflect.Method.invoke(Method.java:313) 
      at 
  org.apache.catalina.startup.Bootstrap.main(Unknown Source) - Root Cause - java.lang.NullPointerException 
      at 
  org.apache.commons.digester.Digester.parse(Digester.java:859) 
      at 
  org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1273) 
      at 
  org.apache.struts.action.ActionServlet.init(ActionServlet.java:460) 
      at 
  javax.servlet.GenericServlet.init(GenericServlet.java:258) 
      at 
  org.apache.catalina.core.StandardWrapper.load(Unknown Source) 
      at 
  org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source) 
      at 
  org.apache.catalina.core.StandardContext.start(Unknown Source) 
      at 
  org.apache.catalina.core.ContainerBase.addChild(Unknown Source) 
      at 
  org.apache.catalina.core.StandardHost.addChild(Unknown Source) 
      at 
  org.apache.catalina.core.StandardHost.install(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.deployApps(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.start(Unknown Source) 
      at 
  org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source) 

RE: Forward To Another Action

2001-10-01 Thread Matthew O'Haire
Title: RE: Forward To Another Action





yes, it's very easy...


in your struts-config.xml put a  tag in your action map, thus:


    
    type="com.matto.myAction"
    name="myForm"
    scope="request"
    input="/index.jsp">
        
    


in your Action code simply return the named forward mapping, thus:


  public ActionForward performAction(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
  throws IOException, ServletException, 
  {
    // implement your action here
    
    // Forward control to the specified success URI
    return (mapping.findForward("nextAction"));
  }




-Original Message-
From: Jeff Gutierrez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 02, 2001 11:27
To: Struts Mailing List
Subject: Forward To Another Action




Hey guys,


Quick question.. can an action forward to another action?  If so, how can 
I do it?


Thanks,


jeff --


-- 
Jeff Gutierrez
Mapua Online! 
http://www.mapua.org
http://www.mapua.com
http://www.mapua.net


Pinoy Ako! May reklamo?





RE: ejb design

2001-10-01 Thread Ali Ozoren

Well- I think I didn't explain myself well enough. I try again between the
lines.

-Original Message-
From: Christophe Marchand [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 6:00 AM
To: [EMAIL PROTECTED]
Subject: Re: ejb design


Wrong idea ! EJB entity are made to "store" one and only one record or
ValueObject. findByPrimaryKey entity method is designed to retrieve one
record, depending on a primary key object. If you use only one entity class
with a hashtable, you'll have a lot of problem to solve :

1 - your primary key object will be udge to store all data from all primary
key from all value objects,
2 - your value objects wouldn't able to extend a primary key object (are be
composed with)

--- I am planning to return only one row from the db. But instead of
attaching each column's value into a separate member variable, I am
proposing to enter values into a hashtable. If there is more than one row in
the resultset it can easily throw a TooManyRows exception, which should
never happen.

3 - you will be obliged to use BMP (Bean managed persistance) entity beans,
with many sql statements in, and it we'll be very difficult to maintain when
you change your data model.

--- I will use BMP but code won't change with structural changes since it
builds the hashtable by looking at the specified table for that bean. So as
soon as you add a field to table, it is ready to be accessed using
getValue("newFieldName") call.

4 - if you decide in the future to split your database in two ones, and then
to deploy on two different servers, you'll keep a lot of unused code in your
classes (or you'll be obliged to re-write everything, both entity beans and
client-side jndi calls...)

Your solution is technically possible, but you are goi ng to spend a lot of
nights to maintain this, for no gain...

--- My solution is supposed to accomplish exact opposite. Less coding, less
maintenance.

Have a look at "Mastering EJB's" book, which is very interesting on ejb's
design considerations...

--- I have that. Ed Roman's. Excellent book IMHO.

Thanks for the input,
--a




Re: html:link and bean:message usage together

2001-10-01 Thread martin . cooper

Using nested double quotes, as you are doing, could be confusing the parser.
Try this instead:

something

Note the use of single quotes around the 'key' value.

Hope this helps.

--
Martin Cooper


- Original Message -
From: "Sean" <[EMAIL PROTECTED]>
To: "Struts User" <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 10:51 AM
Subject: html:link and bean:message usage together


> Hello All,
>
> I am trying to dynamically load a URL from the ApplicationResources file
via
> the bean:message tag in order to make it the href target of a html:link or
a
>  tried:
>
> ">something
>
> nothing, also tried:
>
> ">something
>
> still nothing ... I also tried escaping the " marks in the bean:message
tag
> that didn't work either.  Basically I want a attribute in the html:link
tag
> that allows you  to specify a message resource or I want to be able to
save
> the value from the bean:message tag away into a variable.  Or, finally I
> need to know how via a JSP I can get a handle to the MessageResources and
> extract the url I need from the resource bundle.
>
> Hasn't anyone else wanted to put regional specific URL's into their
> ApplicationResources.properties files to have different locals link to
> different web sites based on location?  Seems like a pretty common thing
to
> me ... I hope this is enough info ... let me know if you need anything
else.
>
> Sean
>





RE: ejb design

2001-10-01 Thread Matthew O'Haire
Title: RE: ejb design





exposing your database field names out of your Entity beans is a bad idea, as
it increases the coupling between your clients and database.  You can't refactor
your schema without affecting your client code!


This is a common error made by people new to EJB but with a lot of RDBMS/RAD
experience.  You have to stop thinking about your entity beans as an eqivalent
to tables in yoru database (it's fine if they match because of synergy between
the class model and the physical storage, but don't let your database drive
you class model).


-Original Message-
From: Ali Ozoren [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 02, 2001 14:23
To: [EMAIL PROTECTED]; Christophe Marchand
Subject: RE: ejb design



Well- I think I didn't explain myself well enough. I try again between the
lines.


-Original Message-
From: Christophe Marchand [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 6:00 AM
To: [EMAIL PROTECTED]
Subject: Re: ejb design



Wrong idea ! EJB entity are made to "store" one and only one record or
ValueObject. findByPrimaryKey entity method is designed to retrieve one
record, depending on a primary key object. If you use only one entity class
with a hashtable, you'll have a lot of problem to solve :


1 - your primary key object will be udge to store all data from all primary
key from all value objects,
2 - your value objects wouldn't able to extend a primary key object (are be
composed with)


--- I am planning to return only one row from the db. But instead of
attaching each column's value into a separate member variable, I am
proposing to enter values into a hashtable. If there is more than one row in
the resultset it can easily throw a TooManyRows exception, which should
never happen.


3 - you will be obliged to use BMP (Bean managed persistance) entity beans,
with many sql statements in, and it we'll be very difficult to maintain when
you change your data model.


--- I will use BMP but code won't change with structural changes since it
builds the hashtable by looking at the specified table for that bean. So as
soon as you add a field to table, it is ready to be accessed using
getValue("newFieldName") call.


4 - if you decide in the future to split your database in two ones, and then
to deploy on two different servers, you'll keep a lot of unused code in your
classes (or you'll be obliged to re-write everything, both entity beans and
client-side jndi calls...)


Your solution is technically possible, but you are goi ng to spend a lot of
nights to maintain this, for no gain...


--- My solution is supposed to accomplish exact opposite. Less coding, less
maintenance.


Have a look at "Mastering EJB's" book, which is very interesting on ejb's
design considerations...


--- I have that. Ed Roman's. Excellent book IMHO.


Thanks for the input,
--a





Re: ejb design

2001-10-01 Thread José PLACIDE
Title: Re: ejb design



Have a look at :

http://java.sun.com/j2ee/blueprints/design_patterns/catalog.html
http://www.theserverside.com/patterns/index.jsp

José.



le 2/10/01 6:37, Matthew O'Haire à [EMAIL PROTECTED] a écrit :


exposing your database field names out of your Entity beans is a bad idea, as 
it increases the coupling between your clients and database.  You can't refactor 
your schema without affecting your client code! 

This is a common error made by people new to EJB but with a lot of RDBMS/RAD 
experience.  You have to stop thinking about your entity beans as an eqivalent 
to tables in yoru database (it's fine if they match because of synergy between 
the class model and the physical storage, but don't let your database drive 
you class model). 

-Original Message- 
From: Ali Ozoren [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, October 02, 2001 14:23 
To: [EMAIL PROTECTED]; Christophe Marchand 
Subject: RE: ejb design 

Well- I think I didn't explain myself well enough. I try again between the 
lines. 

-Original Message- 
From: Christophe Marchand [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 01, 2001 6:00 AM 
To: [EMAIL PROTECTED] 
Subject: Re: ejb design 

Wrong idea ! EJB entity are made to "store" one and only one record or 
ValueObject. findByPrimaryKey entity method is designed to retrieve one 
record, depending on a primary key object. If you use only one entity class 
with a hashtable, you'll have a lot of problem to solve : 

1 - your primary key object will be udge to store all data from all primary 
key from all value objects, 
2 - your value objects wouldn't able to extend a primary key object (are be 
composed with) 

--- I am planning to return only one row from the db. But instead of 
attaching each column's value into a separate member variable, I am 
proposing to enter values into a hashtable. If there is more than one row in 
the resultset it can easily throw a TooManyRows exception, which should 
never happen. 

3 - you will be obliged to use BMP (Bean managed persistance) entity beans, 
with many sql statements in, and it we'll be very difficult to maintain when 
you change your data model. 

--- I will use BMP but code won't change with structural changes since it 
builds the hashtable by looking at the specified table for that bean. So as 
soon as you add a field to table, it is ready to be accessed using 
getValue("newFieldName") call. 

4 - if you decide in the future to split your database in two ones, and then 
to deploy on two different servers, you'll keep a lot of unused code in your 
classes (or you'll be obliged to re-write everything, both entity beans and 
client-side jndi calls...) 

Your solution is technically possible, but you are goi ng to spend a lot of 
nights to maintain this, for no gain... 

--- My solution is supposed to accomplish exact opposite. Less coding, less 
maintenance. 

Have a look at "Mastering EJB's" book, which is very interesting on ejb's 
design considerations... 

--- I have that. Ed Roman's. Excellent book IMHO. 

Thanks for the input, 
--a