RE: what setters do i implement in an indexed tag ?

2001-07-24 Thread Deadman, Hal

Ignore my previous post because I was mistaken. You don't need a setXYZ(int
index, XYZ x) method because struts will call the "public XYZ getXYZ(index
i)" method and then call the appropriate set method on the bean that is
returned. This worked for me (with last nights CVS):






 /td>



which generates field names like "interestRate[0].monthId"

so struts will call form.getInterestRate(0).setMonthId(somevalue)

I had this in my form class:
ArrayList interestRates; // initialized in constructor and reset()

public InterestRateJBean getInterestRate(int index)
{
if (index > interestRates.size()-1)
{
interestRates.add(index,new InterestRateJBean());
}
return (InterestRateJBean) interestRates.get(index);
}

Again, I just got this to work so I may be missing something.

Hal

-----Original Message-
From: Deadman, Hal
Sent: Tuesday, July 24, 2001 11:03 AM
To: [EMAIL PROTECTED]
Subject: RE: what setters do i implement in an indexed tag ?


In the indexed tags write up at
http://www.husted.com/about/struts/indexed-tags.htm, it only mentions the
two types of get methods required in the action form. It doesn't mention the
setters that are required. It looks like the getParameterList() method is
only used by the iterate tag. To populate the form on submit the only setter
needed is:

public void setParameter(int index, Parameter p){...};

In your case that means:

public void setParameter(int index, FieldMapping f) {...};

You probably don't need:
public void setFieldMappings(java.util.Vector newFieldMappings) {
fieldMappings = newFieldMappings;
}
unless you use it in your action to populate the form object before
displaying the form jsp.

I am about to try this myself so this is just a guess.

Hal

-Original Message-
From: Warwick Boote [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 24, 2001 9:09 AM
To: [EMAIL PROTECTED]
Subject: what setters do i implement in an indexed tag ?


I've created a page using indexed tags (neat stuff!).
Here is what is currently working for me:
o If i populate the form's vector, values from that vector are displayed in
the jsp
Here is what it not working:
o when the form is posted back, the vector is null (in the struts perform()
method)
I suspect i haven't implemented some sort of setter within the form but i
can't find an example as to what method should be implemented.  I've tried
ArrayList and using parameterList instead with no different result.
Thanks,
Waz.
=)
Here are some code snippits for help:
---jsp---

 

---Form---
public class FieldsMapForm extends ActionForm {
private String fileColCount;
private java.util.Vector fieldMappings = new java.util.Vector();
private String action;
public String getFileColCount() {
return fileColCount;
}
public void setFileColCount(String newFileColCount) {
fileColCount = newFileColCount;
}
public void setFieldMappings(java.util.Vector newFieldMappings) {
fieldMappings = newFieldMappings;
}
public java.util.Vector getFieldMappings() {
return fieldMappings;
}
public FieldMapping getParameter(int index) {
return (FieldMapping)fieldMappings.elementAt(index);
}
public void setAction(String newAction) {
action = newAction;
}
public String getAction() {
return action;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
fileColCount = null;
fieldMappings = new java.util.Vector();
action = null;
}
}
---The vector contains these:---
public class FieldMapping implements Serializable {
private Integer fieldNumber;
private String attributeCode;
public void setFieldNumber(Integer newFieldNumber) {
fieldNumber = newFieldNumber;
}
public Integer getFieldNumber() {
return fieldNumber;
}
public void setAttributeCode(String newAttributeCode) {
attributeCode = newAttributeCode;
}
public String getAttributeCode() {
return attributeCode;
}
}



RE: what setters do i implement in an indexed tag ?

2001-07-24 Thread Deadman, Hal

In the indexed tags write up at
http://www.husted.com/about/struts/indexed-tags.htm, it only mentions the
two types of get methods required in the action form. It doesn't mention the
setters that are required. It looks like the getParameterList() method is
only used by the iterate tag. To populate the form on submit the only setter
needed is:

public void setParameter(int index, Parameter p){...};

In your case that means:

public void setParameter(int index, FieldMapping f) {...};

You probably don't need:
public void setFieldMappings(java.util.Vector newFieldMappings) {
fieldMappings = newFieldMappings;
}
unless you use it in your action to populate the form object before
displaying the form jsp.

I am about to try this myself so this is just a guess.

Hal

-Original Message-
From: Warwick Boote [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 24, 2001 9:09 AM
To: [EMAIL PROTECTED]
Subject: what setters do i implement in an indexed tag ?


I've created a page using indexed tags (neat stuff!).
Here is what is currently working for me:
o If i populate the form's vector, values from that vector are displayed in
the jsp
Here is what it not working:
o when the form is posted back, the vector is null (in the struts perform()
method)
I suspect i haven't implemented some sort of setter within the form but i
can't find an example as to what method should be implemented.  I've tried
ArrayList and using parameterList instead with no different result.
Thanks,
Waz.
=)
Here are some code snippits for help:
---jsp---

 

---Form---
public class FieldsMapForm extends ActionForm {
private String fileColCount;
private java.util.Vector fieldMappings = new java.util.Vector();
private String action;
public String getFileColCount() {
return fileColCount;
}
public void setFileColCount(String newFileColCount) {
fileColCount = newFileColCount;
}
public void setFieldMappings(java.util.Vector newFieldMappings) {
fieldMappings = newFieldMappings;
}
public java.util.Vector getFieldMappings() {
return fieldMappings;
}
public FieldMapping getParameter(int index) {
return (FieldMapping)fieldMappings.elementAt(index);
}
public void setAction(String newAction) {
action = newAction;
}
public String getAction() {
return action;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
fileColCount = null;
fieldMappings = new java.util.Vector();
action = null;
}
}
---The vector contains these:---
public class FieldMapping implements Serializable {
private Integer fieldNumber;
private String attributeCode;
public void setFieldNumber(Integer newFieldNumber) {
fieldNumber = newFieldNumber;
}
public Integer getFieldNumber() {
return fieldNumber;
}
public void setAttributeCode(String newAttributeCode) {
attributeCode = newAttributeCode;
}
public String getAttributeCode() {
return attributeCode;
}
}



java report article says "bye-bye struts"

2001-06-18 Thread Deadman, Hal

Clearly there are too many java magazines and they will publish anything. In
the July issue of Java Report there is an article titled "Writing a Reusable
Implementation of the MVC Design Pattern" by Prashant Sarode from Brience.
It's interesting because it has a section title of "Bye-Bye Struts". The
section starts out as follows:

"While the Struts framework is a powerful idea, it is not yet a product.
Although excellent in dealing with Web-based applications, Struts is not
ready to take on EJB."

There are other gems in the article but I won't reproduce them all here.

The premise of the article is that the author went looking for an MVC
framework. He found the Blueprint document and liked that but it was too
complicated. He then found Struts but apparently it didn't meet his need for
"a reusable implementation of the MVC pattern." Prashant must be a hard man
to please. I think he wants one framework that can be used for both web
applications and desktop applications. Personally I would rather share the
model components and let my MVC framworks be a little less abstract and more
useful to the task at hand.

I couldn't find the article on-line. I just skimmed the rest of the article
because it it was hard to concentrate or take it seriously after the Bye-Bye
Struts section.

Hal




RE: Struts Beta 03 Build Problem

2001-06-08 Thread Deadman, Hal

Did you get the ant binary distribution or did you build ant yourself?
Building ant yourself may get you a version of ant that supports fewer tasks
depending on what is in your classpath when you build it. Certain classes
such as org.apache.tools.ant.taskdefs.optional.TraXLiason don't get built
unless certain things are found in your classpath when ant is built.

If you have the pre-built ant distribution, make sure the optional ant jar
files are in your classpath. PostgresSQL probably doesn't use the ant style
task which uses org.apache.tools.ant.taskdefs.optional.TraXLiason.



> -Original Message-
> From: McLure, David [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 11:03 AM
> To: '[EMAIL PROTECTED]'
> Subject: Re: Struts Beta 03 Build Problem
>
>
> Hello Oleg,
>
> I tried this on both linux as well as NT, but unfortunately I
> still get
> the
> same error.
> I even tried adding the jdbc2_0-stdext.jar to my \jdk1.3.1\jre\lib\ext
> dir
> as well, but this didn't help.
> I am pretty sure my Ant install basically works because I have built
> other
> things with it such as PostgreSQL.
>
> Any other ideas?
>
> Thanks!
> David McLure
>
> DM> Any idea why I am consistently getting an
> "org.apache.tools.ant.taskdefs.optional.TraXLiason"
> ClassNotFoundException
> when trying an "ant dist" build of jakarta-struts-1.0-b3-src using Ant
> 1.3
> on
> DM> both NT and Linux?  I have what seem to be the only
> required jars in
> my
> path: xalan.jar and jaxp.jar from jaxp-1_1.zip, and
> jdbc2_0-stdext.jar,
> with
> jdk1.3.1?
>
> OA>Place crimson.jar, jaxp.jar, xalan.jar files from
> jaxp-1_1.zip to the
> OA>jdk extension dir - x:\jdk1.3.1\jre\lib\ext for example.



RE: Query: ActionMappings

2001-06-05 Thread Deadman, Hal

Yes you can. Just set the path to the path for the action and include the
.do extension.



XXX

> -Original Message-
> From: Upadhye, Sujit (GEAE, Foreign National)
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 05, 2001 5:52 PM
> To: [EMAIL PROTECTED]
> Subject: Query: ActionMappings
>
>
> Hello,
>
> In local-forwards, can I forward the control to another Action object
> instead of forwarding to a JSP?
>
> Sujit Upadhye
>



RE: Setting focus to textbox?

2001-06-05 Thread Deadman, Hal

Are you getting a JavaScript error? If so this may be fixed in a more recent
struts build. There used to be a problem setting the focus on fields that
used the nested property syntax.

> -Original Message-
> From: Alex Colic [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 05, 2001 4:11 PM
> To: Struts
> Subject: Setting focus to textbox?
>
>
>
> Hi, I am getting an error setting focus to a textbox.
>
> My form tag is as follows:
>
>  method="GET">
>
> I have created a text box as follows:
>
>  maxlength="20" />
>
> What I am trying to do is set focus to the text box when the
> page is loaded.
>
> Any ideas where I have gone wrong?
>
> Thanks for the help.
>
> Alex
>



RE: logic:iterate or bean:write ERROR !!!

2001-06-05 Thread Deadman, Hal

There is a working example in registration.jsp of the struts-example webapp.

> -Original Message-
> From: Geoffrey Van Nuffelen [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 05, 2001 5:28 AM
> To: Struts-User (E-Mail)
> Subject: logic:iterate or bean:write ERROR !!!
> 
> 
> Hi all,
> 
> I always have a problem with the iterate and write tag.
> 
> If I don't specify a "bean:write" tag into an "logic:iterate" 
> tag, I don't
> have any error... But If a specify a write tag I have an 
> exception error :
> 
> The error :
> ---
> javax.servlet.ServletException: Cannot find bean client in scope null
>  at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(
> PageContextImp
> l.java:459)
>  at _0002fClientList_0002ejspClientList_jsp_66._jspService
> 
> 
> My JSP :
> -
> ...
> 
> 
> 
> 
> 
> ...
> test is an object wich has a property clients (array of client ) and a
> method getClients().  pmclient is a property of client ( 
> the method
> getPmclient() exist).
> 
> Is someone has a working example... I would be really happy !!!
> 
> Thanks,
> Geoffrey...
> 
> 



RE: How do I Internationalize ActionError parameter values?

2001-06-04 Thread Deadman, Hal

The request is passed into the validate() function as an argument by the
ActionServlet. You said you wanted the locale in the validate() method,
right?

> -Original Message-
> From: Kyle Robinson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 6:11 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: How do I Internationalize ActionError parameter values?
>
>
> So are you suggesting that I pass the request object to my ActionForm
> constructor when I create it in my action?
>
> -----Original Message-
> From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 13:56
> To: [EMAIL PROTECTED]
> Subject: RE: How do I Internationalize ActionError parameter values?
>
>
> Use the request argument to get the session and then get the
> locale out of
> the session using getAttribute(Action.LOCALE_KEY). If you
> have a shared base
> class for all of your forms (that extends ActionForm) it
> might make sense to
> put a getLocale(request) method in there.
>
> Hal
>
> > -Original Message-
> > From: Kyle Robinson [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, June 04, 2001 4:53 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: How do I Internationalize ActionError parameter values?
> >
> >
> > Thanks Hal.  However, I need to get the locale in the
> > validate() method of
> > my ActionForm object.  Any thoughts?
> >
> > -Original Message-
> > From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, June 04, 2001 13:24
> > To: [EMAIL PROTECTED]
> > Subject: RE: How do I Internationalize ActionError parameter values?
> >
> >
> > Getting the locale object is easy. If you are in an Action
> > perform method,
> > just call:
> >
> > getLocale(request);
> >
> > If you are not in the Action class, you can do what that
> method does,
> >
> > Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
> > if (locale == null)
> >  locale = Locale.getDefault();
> >
> > -Original Message-
> > From: Kyle Robinson [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, June 04, 2001 3:48 PM
> > To: Struts (E-mail)
> > Subject: How do I Internationalize ActionError parameter values?
> >
> >
> > Hey,
> >
> > Looking through the archive I found a couple of notes about
> > internationalizing the ActionError parameters.  I'm talking
> about the
> > following:
> >
> > public ActionError(java.lang.String key,
> >java.lang.Object value0,
> >java.lang.Object value1)
> > Construct an action error with the specified replacement values.
> > Parameters:
> > key - Message key for this error message
> > value0 - First replacement value
> > value1 - Second replacement value
> >
> > What I want to do is pass in keys from the properties file
> > into the second
> > and third parameter.  Specifically I want to pass in the
> > prompt keys to
> > display to the user the fields that are in error.
> >
> > One possible solution proposed was by Craig as follows:
> >
> > The java.text.MessageFormat class (which is how Struts is doing the
> > substitution) does not support internationalizing the replacement
> > parameters directly.  But how about doing this in two steps?
> >
> > * Look up the internationalized replacement value from
> >   a MessageResources bundle
> >
> > * Use the returned String as the replacement value in the
> >   ultimate message.
> >
> > However, I need to get the locale somehow.  It seems alot
> > easier to just
> > override ActionError to accept keys as parameters.  Has
> > anyone overridden
> > the ActionError class to accept "java.lang.String key"
> > parameters instead of
> > "java.lang.Object value0"?
> > Kyle Robinson
> > Systems Consultant
> > Pangaea Systems Inc.
> > (250) 360-0111
> > "Work joyfully and peacefully, knowing that right thoughts
> > and right efforts
> > inevitably bring about right results." - James Allen
> >
>



RE: Any Hashmap examples used in jsp page?

2001-06-04 Thread Deadman, Hal

I don't think what you are trying to do should be done in the JSP by a
struts/custom tag.

Why not copy the value objects in the HashMap to an array based on the order
of the keys in your String array? Then pass the array to the JSP instead of
the HashMap. If you need the keys and they aren't attributes of the value
objects then you can pass the String array of keys to the JSP too.

> -Original Message-
> From: Steve A Drake [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 5:41 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Any Hashmap examples used in jsp page?
>
>
> On Mon, 4 Jun 2001, Shamdasani Nimmi-ANS004 wrote:
>
> > Steve,
> >
> > This is how I used a HashMap in a jsp:
> >
> > 
> >
> > 
> > 
> > 
> > 
> >
> > 
> >
> > getUserList() method in my user_list bean returns a HashMap.
> >
> > Hope this helps.
> >
> > -Nimmi
>
>  Hi Nimmi. Your example would work fine if I didn't care
> about the order
> in which the key/value pairs are displayed. Unfortunately, I need to
> display them in a particular order (given by a String[] of keys).
>



RE: How do I Internationalize ActionError parameter values?

2001-06-04 Thread Deadman, Hal

Use the request argument to get the session and then get the locale out of
the session using getAttribute(Action.LOCALE_KEY). If you have a shared base
class for all of your forms (that extends ActionForm) it might make sense to
put a getLocale(request) method in there.

Hal

> -Original Message-
> From: Kyle Robinson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 4:53 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: How do I Internationalize ActionError parameter values?
>
>
> Thanks Hal.  However, I need to get the locale in the
> validate() method of
> my ActionForm object.  Any thoughts?
>
> -Original Message-
> From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 13:24
> To: [EMAIL PROTECTED]
> Subject: RE: How do I Internationalize ActionError parameter values?
>
>
> Getting the locale object is easy. If you are in an Action
> perform method,
> just call:
>
> getLocale(request);
>
> If you are not in the Action class, you can do what that method does,
>
> Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
> if (locale == null)
>  locale = Locale.getDefault();
>
> -Original Message-
> From: Kyle Robinson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 3:48 PM
> To: Struts (E-mail)
> Subject: How do I Internationalize ActionError parameter values?
>
>
> Hey,
>
> Looking through the archive I found a couple of notes about
> internationalizing the ActionError parameters.  I'm talking about the
> following:
>
> public ActionError(java.lang.String key,
>java.lang.Object value0,
>java.lang.Object value1)
> Construct an action error with the specified replacement values.
> Parameters:
> key - Message key for this error message
> value0 - First replacement value
> value1 - Second replacement value
>
> What I want to do is pass in keys from the properties file
> into the second
> and third parameter.  Specifically I want to pass in the
> prompt keys to
> display to the user the fields that are in error.
>
> One possible solution proposed was by Craig as follows:
>
> The java.text.MessageFormat class (which is how Struts is doing the
> substitution) does not support internationalizing the replacement
> parameters directly.  But how about doing this in two steps?
>
> * Look up the internationalized replacement value from
>   a MessageResources bundle
>
> * Use the returned String as the replacement value in the
>   ultimate message.
>
> However, I need to get the locale somehow.  It seems alot
> easier to just
> override ActionError to accept keys as parameters.  Has
> anyone overridden
> the ActionError class to accept "java.lang.String key"
> parameters instead of
> "java.lang.Object value0"?
> Kyle Robinson
> Systems Consultant
> Pangaea Systems Inc.
> (250) 360-0111
> "Work joyfully and peacefully, knowing that right thoughts
> and right efforts
> inevitably bring about right results." - James Allen
>



RE: How do I Internationalize ActionError parameter values?

2001-06-04 Thread Deadman, Hal

Getting the locale object is easy. If you are in an Action perform method,
just call:

getLocale(request);

If you are not in the Action class, you can do what that method does,

Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
if (locale == null)
 locale = Locale.getDefault();

-Original Message-
From: Kyle Robinson [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 04, 2001 3:48 PM
To: Struts (E-mail)
Subject: How do I Internationalize ActionError parameter values?


Hey,

Looking through the archive I found a couple of notes about
internationalizing the ActionError parameters.  I'm talking about the
following:

public ActionError(java.lang.String key,
   java.lang.Object value0,
   java.lang.Object value1)
Construct an action error with the specified replacement values.
Parameters:
key - Message key for this error message
value0 - First replacement value
value1 - Second replacement value

What I want to do is pass in keys from the properties file into the second
and third parameter.  Specifically I want to pass in the prompt keys to
display to the user the fields that are in error.

One possible solution proposed was by Craig as follows:

The java.text.MessageFormat class (which is how Struts is doing the
substitution) does not support internationalizing the replacement
parameters directly.  But how about doing this in two steps?

* Look up the internationalized replacement value from
  a MessageResources bundle

* Use the returned String as the replacement value in the
  ultimate message.

However, I need to get the locale somehow.  It seems alot easier to just
override ActionError to accept keys as parameters.  Has anyone overridden
the ActionError class to accept "java.lang.String key" parameters instead of
"java.lang.Object value0"?
Kyle Robinson
Systems Consultant
Pangaea Systems Inc.
(250) 360-0111
"Work joyfully and peacefully, knowing that right thoughts and right efforts
inevitably bring about right results." - James Allen



RE: Null PointerException when run with Apache/SSL/Tomcat

2001-06-04 Thread Deadman, Hal

This could also be caused by a link URL including the port number which
sometimes caused a new session to be used. A NPE could result when code that
normally expected something in the session didn't find it because the
session was new. As indicated by the other post, this may be fixed in b3.

> -Original Message-
> From: Dan Miser [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 4:08 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Null PointerException when run with Apache/SSL/Tomcat
>
>
> Your SSL isn't configured properly. Take a look at bug 992 in
> Bugzilla for
> the solution 
> --
> Dan Miser
> http://www.distribucon.com
>
>
> >From: "Brett G. Palmer" <[EMAIL PROTECTED]>
> >
> >We are getting a NullPionterException which seems to
> originate from the the
> >struts-html tag libraries.  The error only occurs when we
> run Struts with
> >Tomcat/Apache and SSL.  If we bypass SSL and just go through
> Apache (port
> >80) we do not see the error.
>
> _
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>



RE: *TED* Re: I am finding that templates are SLOW

2001-06-04 Thread Deadman, Hal

Weblogic sometimes has trouble parsing relative paths. Are you using
Weblogic 6.0? It might be fixed in SP2. I do this <%@ include
file="/include/toppage.inc" %> and it works. Try /inc/imports.jsp.

> -Original Message-
> From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 01, 2001 8:31 PM
> To: [EMAIL PROTECTED]
> Subject: *TED* Re: I am finding that templates are SLOW
>
>
> the Exception
>
> javax.servlet.jsp.JspException: JSP compilation of /inc/template2.jsp
> failed: weblogic.utils.ParsingException: nested TokenStreamException:
> antlr.TokenStreamExc
> eption: Could not include inc/imports.jsp
> at
> org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag
> .java:149)
> at jsp_servlet._logon._jspService(_logon.java:160)
> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java
> :213)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java
> :246)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(W
> ebAppServletCo
> ntext.java:1265)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRe
> questImpl.java
> :1622)
> at
> weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
>
> the page "logon.jsp"
>
> <%@ include file="inc/imports.jsp" %>
> 
>   direct='true'/>
>  
> 
>
>
>
> the template "my_template.jsp"
>
> <%@ include file="inc/imports.jsp" %>
> 
> 
> 
> .
> 
> 
>
>
>
> Common include "imports.jsp"
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
> - Original Message -
> From: "Ted Husted" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 01, 2001 5:10 PM
> Subject: Re: I am finding that templates are SLOW
>
>
> > Template pages can take longer to compile, since there is
> more to do,
> > but should run fine after that.
> >
> > I've used complex templates extensively with other
> containers and have
> > no runtime performance problems.
> >
> > -- Ted Husted, Husted dot Com, Fairport NY USA.
> > -- Custom Software ~ Technical Services.
> > -- Tel 716 737-3463.
> > -- http://www.husted.com/about/struts/
> >
> > > Jonathan wrote:
> > >
> > > I am using weblogic 6 on w2k.  I clicked on a templated page and
> > > MAN.I wait atleast 1 minute for the results.  Is this known?
> >
>



RE: Size on html:file tag??

2001-06-01 Thread Deadman, Hal

If your looking at the documentation on the web, it may be newer than your
build. I think the size tag was added to the tld recently. Do you have a
recent build?

Hal

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 01, 2001 3:30 PM
> To: [EMAIL PROTECTED]
> Subject: Size on html:file tag??
>
>
>
>
> Hi everyone.
>
> I am using the html:file tag, and running up against an
> error, saying the size
> attribute is invalid!  It is clearly marked as valid in the docs!
>
> Is this a bug?  I can take off the size= and it displays fine.
>
> My tag looks like this:  .
>
> Help is appreciated,
>
> Dave
>
>
>



RE: Tag Iterate !!!

2001-06-01 Thread Deadman, Hal

Based on what you are showing in your email, everything looks OK. I don't
think the problem is with the iterate tag. The message
"javax.servlet.ServletException: Cannot find bean client in scope null"
would have to be coming from bean:write which is looking for a bean called
client. It's looking in all scopes (null just means you didn't specify a
scope), so you don't need to add a scope. The iterate tag should put a bean
in the page scope with the name client.

Are you sure that it is the bean:write tag inside the iterate tag that is
causing the error or is there something else on the JSP that you aren't
showing? Try removing the bean:write from the iterate tag and replacing it
with some html.

> -Original Message-
> From: Geoffrey Van Nuffelen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 01, 2001 9:49 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Tag Iterate !!!
>
>
> Hi Ash,
>
> Thanks for your help... But I have the same error with Client.
>
> Have you got a example of this tag method ???
>
> Geoffrey...
> - Original Message -
> From: "A.Sharma" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 01, 2001 12:10 PM
> Subject: RE: Tag Iterate !!!
>
>
> >
> > hi
> > probably change the case of 'c' in client.
> > the class has Capiltal 'c' while in JSP you are accessing small 'c'.
> >
> > :)
> > ash
> >
> > -Original Message-
> > From: Geoffrey Van Nuffelen [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 01, 2001 3:24 PM
> > To: Struts-User (E-Mail)
> > Subject: Tag Iterate !!!
> >
> >
> > Hi all,
> >
> > I try to use the tag iterate (logic) but I can't. I haven't success.
> >
> > I am working on Windows NT with tomcat 3.2 and struts 1.0b-2.
> >
> > I try to pass an array of object ( a personnal client
> class). but when a
> try
> > to access a property I have this error :
> >
> > javax.servlet.ServletException: Cannot find bean client in
> scope null
> >  at
> >
> org.apache.jasper.runtime.PageContextImpl.handlePageException(
> PageContextImp
> > l.java:459)
> >  at
> >
> _0002fClientList_0002ejspClientList_jsp_55._jspService(_0002fC
> lientList_0002
> > ejspClientList_jsp_55.java:214)
> >
> > What I have to ?? I have to specify a scope ???
> >
> > Here you are the code of the .jsp , java class wich put the
> parameter and
> > client.class.
> >
> > .jsp :
> > 
> >
> > ...
> > 
> >
> > 
> >  
> > 
> >
> > 
> > ...
> >
> > Java class :
> > --
> >
> >  Client test[] = clients.getClients();
> >  servlet.log("nmclient from clients : " +
> test[i].getNmclient(), 1); //
> test
> > ... it's working
> >
> >  HttpSession session = request.getSession();
> >  session.setAttribute("test", test);
> >
> >  return (mapping.findForward("success"));
> >
> >
> > Client class :
> > 
> >
> > public class Client {
> >   private String nmclient = "";
> >   private String pmclient = "";
> >   private long cdclient;
> >
> >   public Client() {
> >   }
> >   public String getNmclient() {
> > return nmclient;
> >   }
> >   public void setNmclient(String newNmclient) {
> > nmclient = newNmclient;
> >   }
> >   public String getPmclient() {
> > return pmclient;
> >   }
> >   public void setPmclient(String newPmclient) {
> > pmclient = newPmclient;
> >   }
> >   public long getCdclient() {
> > return cdclient;
> >   }
> >   public void setCdclient(long newCdclient) {
> > cdclient = newCdclient;
> >   }
> > }
> >
> >
> > Thanks in advance for your help.
> >
> > Geoffrey...
> >
> >
> >
> >
> >
> >
> >
> >
> >
>



RE: Resources clarification - is there a work around

2001-06-01 Thread Deadman, Hal

I am suggesting that with a database it would be easier to specify a bundle
for each page so you wouldn't have to worry about collisions. The table
might look something like this:

bundle (null = default)
key
value
locale

(or you could normalize it so the bundle/key would have many values in
another table, one for each supported locale)

The bundle could be the page name if that's how you want to break up your
properties. You would have one application that helped you maintain your
data rather than having hundreds of files. Of course, you would probably
want to have an export/import utiltity so you could check the properties
into source code control. You can do global search and replace with SQL
fairly easily if you have to. One file per jsp doesn't sound _too_ bad but
if you then support three languages I think it becomes a maintenance
problem.

It would be a fair amount of work to get that going so it's not really an
option for you anyway.

Hal


> -Original Message-
> From: Jonathan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 01, 2001 12:38 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Resources clarification - is there a work around
>
>
> I totally respect what you are trying to do with the database
> idea, but the
> problem with managing and keeping track keeps re-appearing -
> that is, if you
> are suggesting getting the data from a database.  In fact,
> now you have
> added another series of steps:
> "what variables do we have, where are we using them, lets now
> go do a search
> in the database to see what we have, lets now see where we use it."
> It's like working with database normalization.  You first
> normalize, then
> you de-normailze to eliminate complexity.  In this case I
> will always need
> to know what text appears on what page.  If they are bundled
> together than
> it is a matter of finding the associated text file for that
> page.  Otherwise
> I have to go hunting and querying.  Want to add a page?  Add
> a text file.
> Want to change an item on a page?  Change it in all the
> associated text
> files (one for each language translation).  Yes you cant make a global
> change.  But you CAN do a global search and replace!
>
>
> - Original Message -
> From: "Deadman, Hal" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 01, 2001 12:18 PM
> Subject: RE: Resources clarification - is there a work around
>
>
> > Let me preface this by saying I haven't given this much
> thought. Since
> > struts already supports multiple bundles (i.e. with the
> bundle attribute
> on
> > bean:message) would it make since to have struts read all
> the resource
> files
> > from a particular directory or path and use the base filename of the
> > property file as the name of the bundle? That would allow
> people to break
> up
> > their properties files however they want to. The default
> file with the
> > bundle key Action.MESSAGES_KEY would still be used whenever
> a bundle was
> not
> > specified.
> >
> > I think if I were going to have a huge number of bundles
> like one per
> page,
> > I would pull my resources from a database using a custom
> > DatabaseMessageResourceFactory. I have considered writing a
> such a factory
> > and the accompanying webapp to maintain the translations
> but I haven't
> > followed through.
> >
> > Hal
> >
> > > -Original Message-
> > > From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, May 31, 2001 9:30 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Resources clarification - is there a work around
> > >
> > >
> > > The problem we found was that a master list is impossible to
> > > manage.  For
> > > instance, on the soon to arrive 10th page of the property
> > > file, you will
> > > have to search all of the previous pages to check to see if
> > > you already used
> > > the property name already.  Chances are that you did use the
> > > name already
> > > because an individual tends to think in their own way and
> > > come up with the
> > > same naming schemes, and you will have more for the property
> > > name "name" in
> > > many many other pages.  Then some designer or manager tells
> > > you to add a
> > > form field which you recognize that you could use "name"
> as the field
> > > property and realize you have to rethink the way you have
> > > been and will
> > > continue naming things, such as "signup_name", "logon_name&qu

RE: Resources clarification - is there a work around

2001-06-01 Thread Deadman, Hal

Let me preface this by saying I haven't given this much thought. Since
struts already supports multiple bundles (i.e. with the bundle attribute on
bean:message) would it make since to have struts read all the resource files
from a particular directory or path and use the base filename of the
property file as the name of the bundle? That would allow people to break up
their properties files however they want to. The default file with the
bundle key Action.MESSAGES_KEY would still be used whenever a bundle was not
specified.

I think if I were going to have a huge number of bundles like one per page,
I would pull my resources from a database using a custom
DatabaseMessageResourceFactory. I have considered writing a such a factory
and the accompanying webapp to maintain the translations but I haven't
followed through.

Hal

> -Original Message-
> From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 31, 2001 9:30 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Resources clarification - is there a work around
>
>
> The problem we found was that a master list is impossible to
> manage.  For
> instance, on the soon to arrive 10th page of the property
> file, you will
> have to search all of the previous pages to check to see if
> you already used
> the property name already.  Chances are that you did use the
> name already
> because an individual tends to think in their own way and
> come up with the
> same naming schemes, and you will have more for the property
> name "name" in
> many many other pages.  Then some designer or manager tells
> you to add a
> form field which you recognize that you could use "name" as the field
> property and realize you have to rethink the way you have
> been and will
> continue naming things, such as "signup_name", "logon_name",
> "search_name",
> "artist_name", "publication_name"..  after completeing
> the 30th jsp page
> you say to yourself,  "man(sigh), if I just had a properties
> file for each
> page or include, than I wouldnt have a 3000 line properties
> file with which
> I cannot sort, group, or categorize all of the property names nicely".
>
> It was easier for us to:
> 1) know what was on any page (just look at the like named
> proerties file)
> 2) fix or add to a page without thinking if the name was
> used, and whether I
> thus have to come up with a naming scheme for this one or all of them.
> 3) just hand over translatable content to the translators on
> a page by page
> basis.
> 4) if you later decide to keep it in the database you can
> because you just
> associate pageName with propertyName
>
> logon.jspuser.name
> logon.jspuser.address
> logon.jsp
> signup.jspuser.name
> signup.jspuser.password
> checkout.jspuser.name
>
> This is much easier.  Try it.  You will see how managing this
> grand list
> sucks ;^)
>
> If your developers are anything like places I have worked
> for, than you know
> how things
> get out of control.  I just take this as a given.  With my
> way, at any time,
> I can email out new pages and text  to be translated (by a
> clerk, designers,
> editors).  I send a visual and typeographic pair of items
> that go together
> and that an editor can say, "yes, this is what I want the
> caption to say on
> this page".  Do I repeadedly send the editor chunks of a
> 3000+ item list and
> then say:
> (me) "can you tell me what you want to say in these new lines
> of text?"
> (editor) "which lines?"
> (me) " the ones I highlighted"
> (editor) "which of these lines of text is on this page we are talking
> about?".
>
> Do you see why I say the benefits from a big list loose out
> to a small list?
> What if I delete one.  What pages does it effect? Which ones
> have been left
> orphaned?  You dont know in any easy way.  For search and
> replace you now
> have to search each particularly named item.  If they all were called
> "user.name" I could just search and replace it everywhere
> below a directory.
> If one is "logon.user.name" and another "search.user.name"
> you now have to
> search and find each unique one. Could you get them all, or
> did you miss
> some because someone was using "logon.User.Name" instead of
> "logon.user.name" or "logonUserName".
>
> - Original Message -
> From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 31, 2001 5:50 PM
> Subject: RE: Resources clarification - is there a work around
>
>
> > Hi Guys,
> >
> > From my personal experience it would not be a bad
> idea for struts
> to
> > support multiple resource bundles. I will explain my reasons below.
> >
> > At present struts has one resource bundle in which you can
> include error
> > messages , confirmation messages , labels on html fileds
> etc For a big
> > application ( like i am on right now. We are going to have
> > 50 jsp pages
> > minimum) it is quite a pain in the neck to add properties
> to a single
> file.
> > Besides the developers having to compete with one ano

RE: output xml file

2001-05-31 Thread Deadman, Hal

If the perform method handles the response output, just return null.

> -Original Message-
> From: Wu, Ying (LNG-CIS) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 31, 2001 4:15 PM
> To: '[EMAIL PROTECTED]'
> Subject: output xml file
> 
> 
> I need to send a string which represents a xml file to 
> browser, I need to
> call response.setContentType("text/xml").  But it is at 
> ActionServlet level
> and is default to "text/html".
> 
> 1. Any idea?
> 2. I can do the output at MyAction.perform(, request, 
> response, ) level, but
> how to handle the return type of this method?
> 
> Thanks.
> 
> Ying
> 



RE: Any hosting sites that use Struts?

2001-05-31 Thread Deadman, Hal



It looks like ExpertHost offers ASP support and it will 
offer JSP support "shortly". 
 
http://www.experthost.com/developers/
 
 

  -Original Message-From: Jeff Trent 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, May 31, 2001 3:21 
  PMTo: [EMAIL PROTECTED]Subject: Re: Any 
  hosting sites that use Struts?
  Problem is I'm looking for a hosting facility 
  that offers Java + ASP hosting.  Usually, I find these services lean one 
  way or another.
   
  A bit off subject, but I'm wondering how these 
  providers have their environment setup so that each user can have a separate 
  App Server / VM, classpath, etc. and can be managed separately (on NT).  
  If anyone knows, I'd be interested to hear from you...
   
  Tnx.
   
  
- Original Message - 
From: 
Tom Miller 

To: [EMAIL PROTECTED] 

Sent: Thursday, May 31, 2001 10:30 
AM
Subject: Re: Any hosting sites that use 
Struts?
I've had small Struts web apps hosted on www.aoindustries.com for several 
months now, and am happy with the service. They provide the entire Jakarta 
project software suite. They are a small shop, but have very friendly, 
competent tech support. 
Jeff Trent wrote: 

  
  Anyone know of a hosting facility that 
  offers Java web hosting + Struts?-- Tom 
Miller Miller Associates, Inc. [EMAIL PROTECTED] 641.469.3535 
Phone 413.581.6326 FAX   


RE: Precompiling JSP Pages?

2001-05-31 Thread Deadman, Hal

If you are using Weblogic there is an Ant task that does it in the optional
package. I can't vouch for how well the current version works but I am using
a modified version that works fine. Tomcat has a batch file that will run
Jasper on a whole directory tree full of jsps. I used it once but I never
tried to  run the compiled jsps.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 31, 2001 12:18 PM
> To: [EMAIL PROTECTED]
> Subject: Precompiling JSP Pages?
>
>
> Anyone know how to precompile the JSP pages?
>



RE: getting a specific ArrayList element

2001-05-30 Thread Deadman, Hal

Each element in the collection is exposed as a bean with name determined by
the "id" attribute of the iterate tag. So inside your tag you can access
that bean in a scriptlet or with the bean:write tag. The bean will be of
type Object unless you use the type attribute of the iterate tag.

> -Original Message-
> From: Charlesworth, Chico [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 30, 2001 12:09 PM
> To: '[EMAIL PROTECTED]'
> Subject: getting a specific ArrayList element
>
>
>
> To iterate through a java.util.ArrayList i use
>  struts tag
> and that works fine ...
>
> but which tag do i need to use and what attribute settings do
> i need to
> access a specific ArrayList element?
> for example if i wanted to access the second element of my
> ArrayList using
> jsp, i would just do:
>
> <%MyObject o = (MyObject) myArrayList.get(1);%>
>
> Any ideas?
> chico
>
>
>
> --
> The content of this e-mail is confidential, may contain
> privileged material
> and is intended solely for the recipient(s) named above. If
> you receive this
> in error, please notify Software AG immediately and delete
> this e-mail.
>
> Software AG (UK) Limited
> Registered in England & Wales 1310740
> Registered Office: Hudson House, Hudson Way,
> Pride Park, Derby DE24 8HS
>



RE: Any hosting sites that use Struts?

2001-05-30 Thread Deadman, Hal



I 
looked around for sites that host jsp/servlet based apps awhile ago and came up 
with these links:
 
http://www.irdesign.com/services/hosting/website_hosting.html
http://www.hostjsp.com/
http://www.mmaweb.net/
http://www.servlets.net/index.html
http://www.infinitehost.com/
 
I 
can't vouch for any of them. I would be interested in hearing feedback about 
these providers or other options. 
 
Hal
 

  -Original Message-From: Jeff Trent 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, May 30, 2001 12:12 
  PMTo: [EMAIL PROTECTED]Subject: Any hosting 
  sites that use Struts?
  Anyone know of a hosting facility that offers 
  Java web hosting + Struts?
   


RE: html:button and html:radio in 1.0b2

2001-05-30 Thread Deadman, Hal

I think problem 1 was fixed last night. Problem 2 was an accidental
regression and has been reported as a bug.

> -Original Message-
> From: Klaus Thiele [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 30, 2001 6:20 AM
> To: STRUTS-USER
> Subject: html:button and html:radio in 1.0b2
>
>
> Hello,
>
> i'm currently switching our application from struts-0.5 to 1.0b2
> and i have to made some stupid changes in some of my
> jsp-pages:
>
> 1) html:radio accepts no 'tabindex'
> 2) html:button does not get his label from the tag-body
> (html:submit does it)
>
> is there a reason for this changes?
>
> thanks
>   klaus
>
> --
> Klaus Thiele - Personal & Informatik AG
> mailto:[EMAIL PROTECTED]
>
>  "Your mouse has moved.
>   Windows must be restarted for the change to take effect."
>



RE: Dynamic action mappings

2001-05-29 Thread Deadman, Hal

The ActionForm and Action classes both have a getServlet() method that will
return a reference to the ActionServlet instance.

> -Original Message-
> From: Larry Meadors [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 29, 2001 10:57 AM
> To: [EMAIL PROTECTED]
> Subject: Dynamic action mappings
>
>
> I want to add and remove action mappings/forwards/beans on the fly.
>
> What's the best way to do that?
>
> I saw in the struts-config.xml file some actions at the
> bottom that look promising, but don't understand how those
> would be used.
>
> I'm thinking that I could also use the addMapping(),
> addForward(), addFormBean() functions, if I could get a
> reference to the ActionServlet instance. Is there a way to do that?
>
> Any advice?
>
> Larry
>
>



RE: action classes

2001-05-29 Thread Deadman, Hal

I actually use EJBs for the model objects. I have some non-struts related
JavaBeans that I use for transport objects. These are the beans that I nest
inside Struts action forms. They are passed to EJBs model components. That
way the EJBs have no Struts dependancies and I don't have to duplicate the
JavaBeans in the ActionForm.

The transport JavaBeans don't have any business rules or logic. The business
logic is in session beans and entity beans are used mainly for container
managed persitence. The entity beans typically duplicate the same fields
that are in the transport JavaBeans but the properties are not necessarily
exposed in the remote interface. Not every entity bean has an associate
transport bean and not every struts form has a nested bean. I only use them
for entities with many properties.

I think there is a different term rather than "transport Javabeans" for this
pattern but I forget what it is. It basically allows for methods with fewer
parameters.

You are basically going to have to duplicate the properties in at least two
places or you will tie your model components too closely to your view
components. Another technique for making this a painless as possible is to
use the BeanUtils.copyProperties() method to copy data from the view bean to
the model bean.

Hal



> -Original Message-
> From: Mikkel Bruun [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 29, 2001 1:32 PM
> To: Deadman, Hal; '[EMAIL PROTECTED] '
> Subject: RE: action classes
>
>
> Hi Hal,
>
> So you would the ActionForm to contain an instance of the "business
> model"???
>
> thats an intereting approach...tried it in practice???
>
> right now im struggling with some rather large "business
> models" which has
> mostof their attributes duplicated in the action form...
>
> Mikkel
>
> -Original Message-
> From: Deadman, Hal
> To: [EMAIL PROTECTED]
> Sent: 29-05-2001 15:49
> Subject: RE: action classes
>
> Struts allows you to nest your existing beans inside the form
> class. You
> won't need to duplicate the get/set methods. You reference the nested
> beans
> with dot notation. There are examples of this in the
> html-setters.jsp in
> the
> excercise-taglib webapp that comes with struts.
>
> > -Original Message-
> > From: Neil Blue [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, May 26, 2001 8:08 PM
> > To: [EMAIL PROTECTED]
> > Subject: action classes
> >
> >
> > Hello,
> >
> > I am extending the ActionForm class to create my own bean
> > Form classes.
> > However I already have my own set of beans with all the getter and
> > setter methods that the Form class will need. Does anyone
> > know if there
> > are any plans to make ActionForm etc, interfaces, as I would
> > rather not
> > change the basic struts package.
> >
> > Cheers
> > Neil
> >
>



RE: action classes

2001-05-29 Thread Deadman, Hal

Struts allows you to nest your existing beans inside the form class. You
won't need to duplicate the get/set methods. You reference the nested beans
with dot notation. There are examples of this in the html-setters.jsp in the
excercise-taglib webapp that comes with struts.

> -Original Message-
> From: Neil Blue [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 26, 2001 8:08 PM
> To: [EMAIL PROTECTED]
> Subject: action classes
>
>
> Hello,
>
> I am extending the ActionForm class to create my own bean
> Form classes.
> However I already have my own set of beans with all the getter and
> setter methods that the Form class will need. Does anyone
> know if there
> are any plans to make ActionForm etc, interfaces, as I would
> rather not
> change the basic struts package.
>
> Cheers
> Neil
>



RE: Production uses of Jakarta STRUTS 1.0

2001-05-25 Thread Deadman, Hal

The links below are from http://www.husted.com/about/struts/. I have noticed
email addresses on struts-user from McGraw-Hill, Proctor&Gamble, and Enron
in the last week or so. It looks like some big companies are starting to use
it. It's real but it's relatively new so you aren't going to see it in use
by really big well known sites. The fact that they are well known means that
they have been around longer than struts.

Clickstart Tutoring - http://www.clickstarttutoring.com/
Enitel - http://adminweb.enitel.no/login.jsp
iKnowBase - http://www.iknowbase.com/
IronMax  - http://ironmax.com/ (see Equipment Information Products)
Povoglie -  http://www.penza.ru/povolgie - "Goverment regional press
services news center in Russia, middle Volga."
TeaTimeJ - http://www.webappcabaret.com/teatimej/

> -Original Message-
> From: Ronne, David [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 25, 2001 4:37 PM
> To: '[EMAIL PROTECTED]'
> Subject: Production uses of Jakarta STRUTS 1.0
>
>
> As part of the Architecture and Technology group in our
> organization, we are
> recommending the use of the Struts framework over a proprietary one
> currently in use by one of our development groups.
>
> They want to know if this is real or just vapor-ware.
>
> Is anyone aware of current production uses of the framework to
> prove it works in real life?
>
>
> Thanks in Advance
>   Dave Ronne
>   Principle SWE A&T
>   Fidelity Corp.
>



RE: what is 'input' for

2001-05-24 Thread Deadman, Hal

That's where you will forwarded back to if the validate() function on the
ActionForm returns errors.

> -Original Message-
> From: Blue, Neil [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 24, 2001 10:22 AM
> To: [EMAIL PROTECTED]
> Subject: what is 'input' for
>
>
> Hello,
>
> I am trying to figure out what the input attribute in the action
> mappings is
> for. Could anyone help please.
>
> Cheers
> Neil



RE: Options tag problem

2001-05-24 Thread Deadman, Hal

I don't think the option tag will work like that. You can either put your
Hashset in some scope, call it something like "persons" and then use the




Or you could have two methods on your form, one that returns a collection of
Strings for the label and another that returns a collection of Strings for
the value. If they are the same then what you are doing  will work but you need to change the getPersons method
to return a collection of strings instead of beans.

The options documentation is confusing but giving the tag any more
flexibility would only make it that much more complex. The fact that the
attributes "property" and "labelProperty" mean two different things
depending on whether "collection" is used makes it confusing. You basically
need the first usage with an alternate way of specifying the collection.

Disclaimer: I could be confused myself.

Hal

> -Original Message-
> From: Mikkel Bruun [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 24, 2001 6:13 AM
> To: '[EMAIL PROTECTED] '
> Subject: Options tag problem
>
>
>
> Hi Guys!
>
> I have an ActionForm which contains a HashSet named Persons that
> contains
> several instances of Person
>
> In my jsp i want a dropdown box showing the Person's name.
>
> code:
> 
>
> This points to the getPersons() method in the ActionForm
> that'll return
> a
> HashSet...
> Now I need to access each elements getName() method, but
> looking through
> the
> options tag code, it seems like it can only handle Collections of
> Stringsis this correct
>
> Any suggestions on how to solve it???
>
> thanks
>
> Mikkel



RE: Regarding making your own tags with Struts

2001-05-24 Thread Deadman, Hal

You can change the font of the header by modifying the values for
errors.header and errors.footer in your application resources properties
files.

errors.footer=
errors.header=Validation ErrorYou must
correct the following error(s) before proceeding:

You can write your own tags in struts the same way you write JSP tags
without struts. Look on this page for links to tutorials.
http://jsptags.com/gettingstarted/

> -Original Message-
> From: Raj Malhots Surrey [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 24, 2001 3:33 PM
> To: [EMAIL PROTECTED]
> Subject: Regarding making your own tags with Struts
>
>
>
> Hi,
>
> I have a field called email in my form.
> I do have an error with this field.So, in my ActionForm I add
> an ActionError for that and I can access it in my JSP file
> using  tag.
> But can you tell me if there is some way or some tag in
> Struts by which I can change the font of the label Email in
> red after checking if there is an error with the email field.
> If not can u suggest if some other way is possible.
> Also if someone can tell me how to write my own tags with Struts.
>
> Thankx in advance.
>
> Raj
>
> - Original Message --
> Peter Alfors <[EMAIL PROTECTED]> wrote:
> To:[EMAIL PROTECTED]
> From:Peter Alfors <[EMAIL PROTECTED]>
> Date:Thu, 24 May 2001 12:57:57 -0500
> Subject:Re: struts framework without its TAG LIBRARIES in jsp
> pages how?
>
> when you submit a form, you just need to set the action to
> the action class
> that you want in invoke.
> 
>
> If you have your web.xml set up to use the Struts
> ActionServlet whenever the
> desired mapping is encountered, then
> you should be fine.
>
> Check out the Struts example application to make sure that
> your web.xml file is
> set up correctly.
>
> HTH,
> Pete
>
>
> Sanjay Melinamani wrote:
>
> > but my question is how? If we use HTML, how is the "ActionForm" gets
> > delegated to Action::perform() method?
> > I guess we have to explicitly use the ActionForm bean and
> call its "set"
> > methods...I am not sure about this !
> >
> > If u suggest me as how is the ActionForm will be delegated to the
> > Action::perfom method, that would be great !
> >
> > thanx
> > sanjay
> >
> > > -Original Message-
> > > From: Nanduri, Amarnath [SMTP:[EMAIL PROTECTED]]
> > > Sent: Thursday, May 24, 2001 5:21 AM
> > > To:   '[EMAIL PROTECTED]'
> > > Subject:  RE: struts framework without its TAG
> LIBRARIES in jsp pages
> > > how?
> > >
> > > You can ignore the Tag Libraries and still use the
> ActionServlet, Actions
> > > and ActionForms functionality. Write your own html . The
> beauty of using
> > > the
> > > Tag Libraries is that they are fully internationalized. But if
> > > internationalization is not an issue, then by all means
> write your own
> > > html
> > > without using the Tag Libraries.
> > >
> > >
> > > cheers,
> > > Amar..
> > >
> > > -Original Message-
> > > From: Sanjay Melinamani [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, May 23, 2001 7:49 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: struts framework without its TAG LIBRARIES in
> jsp pages how?
> > >
> > >
> > > > hi,
> > > > I am trying to make use of struts framework in our
> application. But can
> > > I
> > > > implement the frame work "without" using its Tag
> libraries? If so how
> > > can
> > > > I do it? Basically I do not wnat to use Struts TAG
> LIBRARIES in my JSP
> > > > pages.
> > > >
> > > > thanx
> > > > regards
> > > > sanjay
> > > >
>
>
> _
> Chat with your friends as soon as they come online. Get Rediff Bol at
> http://bol.rediff.com
>
>
>
>



RE: Options tag problem

2001-05-24 Thread Deadman, Hal

I don't think the option tag will work like that. You can either put your
Hashset in some scope, call it something like "persons" and then use the




Or you could have two methods on your form, one that returns a collection of
Strings for the label and another that returns a collection of Strings for
the value. If they are the same then what you are doing  will work but you need to change the getPersons method
to return a collection of strings instead of beans.

The options documentation is confusing but giving the tag any more
flexibility would only make it that much more complex. The fact that the
attributes "property" and "labelProperty" mean two different things
depending on whether "collection" is used makes it confusing. You basically
need the first usage with an alternate way of specifying the collection.

Disclaimer: I could be confused myself.

Hal

> -Original Message-
> From: Mikkel Bruun [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 24, 2001 6:13 AM
> To: '[EMAIL PROTECTED] '
> Subject: Options tag problem
>
>
>
> Hi Guys!
>
> I have an ActionForm which contains a HashSet named Persons that
> contains
> several instances of Person
>
> In my jsp i want a dropdown box showing the Person's name.
>
> code:
> 
>
> This points to the getPersons() method in the ActionForm
> that'll return
> a
> HashSet...
> Now I need to access each elements getName() method, but
> looking through
> the
> options tag code, it seems like it can only handle Collections of
> Stringsis this correct
>
> Any suggestions on how to solve it???
>
> thanks
>
> Mikkel



RE: dynamic button names

2001-05-24 Thread Deadman, Hal

It looks like this was broken in a recent update. The ButtonTag.java needs a
doAfterBody() method in order to set the text instance variable to the body
content. That will make it work like the SubmitTag.java. You should submit
this as a bug on Bugzilla. http://nagoya.apache.org/bugzilla/ If you can't
do that, let me know and I will do it.


/**
 * Save the associated label from the body content.
 *
 * @exception JspException if a JSP exception has occurred
 */
public int doAfterBody() throws JspException {

if (bodyContent != null) {
String value = bodyContent.getString().trim();
if (value.length() > 0)
text = value;
}
return (SKIP_BODY);

}

Hal
> -Original Message-
> From: Thane Eisener [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 24, 2001 11:19 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: dynamic button names
>
>
> I'm not able to get this to work since I upgraded to b2.
>
> The following shows a button with the text "Click" (I assume
> "Click" is
> the HTML default). All the other internationalized strings are working
> fine. Any ideas?
>
> 
>   
> 
>
>
>
> -Original Message-
> From: Blue, Neil [ mailto:[EMAIL PROTECTED]
> 
> ]
> Sent: Thursday, May 24, 2001 10:53 AM
> To: [EMAIL PROTECTED]
> Subject: RE: dynamic button names
>
>
> Thank you Peter,
>
> It has also now been pointed out to me that you can set the
> value of a
> submit button by using a two part tag
>
> 
> 
> 
>
> or something close to this if I remember correct. I have found it hard
> to
> get some docs on this.
>
> Cheers
> Neil
>
> -Original Message-
> From: Peter Alfors [ mailto:[EMAIL PROTECTED]
>  ]
> Sent: 24 May 2001 14:39
> To: [EMAIL PROTECTED]
> Subject: Re: dynamic button names
>
>
> It looks as though the ButtonTag and SubmitTag do not allow you to do
> this.
>
> Therefore, you have a few other options.
>
> 1.  Use HTML along with the message tag...
>
>  value=" key="myBundleKey"/>">
>
> 2. Write your own custom tag.  You could extend the SubmitTag and
> over-ride
> the getValue() call to retrieve a resoure bundle key.
>
> 3.  Last resort: Retrieve the bundle key through the message resources
> class
> and place it into a script variable.
>  Then place the script variable in the custom tag...
>  This is ugly, so I would not do this unless you have a
> good reason
> to.
>
> MessageResources bundle =
>   (MessageResources)
> pageContext.getServletContext().getAttribute(Action.MESSAGES_KEY);
> String myValueRetrievedFromBundle = bundle.getMessage("myKey");
> 
>
> (The code may not be exactly right.. I have not implemented
> this myself)
>
>
> HTH,
> Pete
>
>
> Neil Blue wrote:
>
> > Hello,
> >
> > I am planning a struts app and I would like to know please
> if there is
> a
> > way to set the text of a submit button, based on a key from the
> > ApplicationResources.properties file.
> >
> > Thank you
> >
> > Neil Blue
>



RE: dynamic button names

2001-05-24 Thread Deadman, Hal

Isn't this what you want to do?



> -Original Message-
> From: Peter Alfors [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 24, 2001 9:39 AM
> To: [EMAIL PROTECTED]
> Subject: Re: dynamic button names
> 
> 
> It looks as though the ButtonTag and SubmitTag do not allow you to do
> this.
> 
> Therefore, you have a few other options.
> 
> 1.  Use HTML along with the message tag...
> 
>  value=" key="myBundleKey"/>">
> 
> 2. Write your own custom tag.  You could extend the SubmitTag and
> over-ride
> the getValue() call to retrieve a resoure bundle key.
> 
> 3.  Last resort: Retrieve the bundle key through the message resources
> class
> and place it into a script variable.
>  Then place the script variable in the custom tag...
>  This is ugly, so I would not do this unless you have a 
> good reason
> to.
> 
> MessageResources bundle =
>   (MessageResources)
> pageContext.getServletContext().getAttribute(Action.MESSAGES_KEY);
> String myValueRetrievedFromBundle = bundle.getMessage("myKey");
> 
> 
> (The code may not be exactly right.. I have not implemented 
> this myself)
> 
> HTH,
> Pete
> 
> 
> Neil Blue wrote:
> 
> > Hello,
> >
> > I am planning a struts app and I would like to know please 
> if there is
> a
> > way to set the text of a submit button, based on a key from the
> > ApplicationResources.properties file.
> >
> > Thank you
> >
> > Neil Blue
> 
> 



RE: How to use the new iterate tag?

2001-05-24 Thread Deadman, Hal

It seems like overkill because the alternative would be simple scriptlet:

<% int i=0; %>

<%= ++i %>


But I think it makes sense to have a tag, my opinion is that the overhead from tags 
should be insignificant compared to the overhead from network and database access. 
Nobody has to use the tag if they think it's overkill. 

I submitted the tag as a low priority enhancement request on bugzilla. 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1871

Hal

> -Original Message-
> From: Amos Shapira [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 24, 2001 2:38 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: How to use the new iterate tag?
> 
> 
> Hi,
> 
> Thanks a lot!  That's exactly what I wanted.
> 
> You said that it seems like an overkill to use a tag, is there
> another way to access this index?
> 
> What are the chances to see this tag in the library?
> 
> Cheers,
> 
> --Amos
> 
> > -Original Message-
> > From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 23, 2001 7:29 PM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: How to use the new iterate tag?
> > 
> > 
> > Do you just want to display the index? If you do, I just 
> > wrote a custom tag that does that. It allows me to remove one 
> > of the last instances of scriptlets that I have in my jsps. 
> > It's seems overkill to have a tag that just displays the 
> > iterate counter but oh well. If nothing else, you can use it 
> > as an example of how to access the index of the iterate tag. 
> 
> [ rest deleted ]
> 



RE: How to use the new iterate tag?

2001-05-23 Thread Deadman, Hal

Do you just want to display the index? If you do, I just wrote a custom tag that does 
that. It allows me to remove one of the last instances of scriptlets that I have in my 
jsps. It's seems overkill to have a tag that just displays the iterate counter but oh 
well. If nothing else, you can use it as an example of how to access the index of the 
iterate tag. 


package org.apache.struts.taglib.logic;

import java.util.Arrays;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.util.IteratorAdapter;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.PropertyUtils;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.util.ResponseUtils;


/**
 * Custom tag that displays the count from the parent iterator tag
 *
 * @author Hal Deadman
 * @version $Revision:$ $Date:$
 */

public class IterateCountTag extends TagSupport {

// - Instance Variables
/**
 * The number to add to the zero based index
 */
protected String offset = null;

public String getOffset() {
return (this.offset);
}

public void setOffset(String offset) {
this.offset = offset;
}

// - Public Methods

/**
 * Don't do anything
 *
 * @exception JspException if a JSP exception has occurred
 */
public int doStartTag() throws JspException {
return (SKIP_BODY);
}

/**
 * Write out the count from outer iterate tag
 *
 * @exception JspException if a JSP exception has occurred
 */
public int doEndTag() throws JspException {
// determine offset as int, default to 1
int offsetnum = 1;
try
{
if (offset != null)
{
offsetnum = Integer.parseInt(offset);
}
}
catch (NumberFormatException nfe)
{
offsetnum = 1;
}

// look for outer iterate tag
IterateTag iterateTag = (IterateTag) findAncestorWithClass(this, 
IterateTag.class);
if (iterateTag == null)
{
// this tag should only be nested in iteratetag, if it's not, don't do 
anything
return EVAL_PAGE;
}

// calculate index
int index = iterateTag.getIndex() + offsetnum;

HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();

// Render this element to our writer
ResponseUtils.write(pageContext, String.valueOf(index));

// Evaluate the remainder of this page
return (EVAL_PAGE);
}


/**
 * Release all allocated resources.
 */
public void release() {
super.release();
offset = null;
}
}


-- struts-logic.xml snippet or info needed for tld
  
iteratecount

Displays the counter for a surrounding iterate tag.

org.apache.struts.taglib.logic.IterateCountTag
empty

Displays the counter for a surrounding iterate tag


  offset
  false
  true
  
  Value to be added to iterate index value. Default is 1.
  

  
  

Usage:





 


 




> -Original Message-
> From: Amos Shapira [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 23, 2001 3:17 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: How to use the new iterate tag?
> 
> 
> Thanks, I just tried this and it works great!
> 
> I still wander how should I go about accessing the index in
> an "iterate" tag.
> 
> Cheers,
> 
> --Amos
> 
> > -Original Message-
> > From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, May 22, 2001 11:37 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: How to use the new iterate tag?
> > 
> > 
> > You should be using struts-logic.tld, not struts.tld. Never 
> > use struts.tld.
> > 
> > > -Original Message-
> > > From: Amos Shapira [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, May 22, 2001 1:16 PM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: RE: How to use the new iterate tag?
> > > 
> > > 
> > > I use the TLD extracted from the .jar file, as far as I can
> > > tell.
> > > 
> > > > -Original Message-
> > > > From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, May 22, 2001 6:14 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: RE: How to use the new iterate tag?
> 

RE: How to use the new iterate tag?

2001-05-22 Thread Deadman, Hal

You should be using struts-logic.tld, not struts.tld. Never use struts.tld.

> -Original Message-
> From: Amos Shapira [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 22, 2001 1:16 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: How to use the new iterate tag?
> 
> 
> I use the TLD extracted from the .jar file, as far as I can
> tell.
> 
> > -----Original Message-
> > From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, May 22, 2001 6:14 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: How to use the new iterate tag?
> > 
> > 
> > Type should be available as an attribute of the iterate tag. 
> > Which tld are you using? The tld and the documentation are 
> > generated from the same xml file so they shouldn't be out of sync. 
> > 
> > I think the iterate tag exposes the index for use by nested 
> > custom tags, but I don't know if any tags in struts make use 
> > of the exposed index. Maybe you have to write your own tag to 
> > access it?
> > 
> > Hal
> > 
> > > -Original Message-
> > > From: Amos Shapira [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, May 22, 2001 7:19 AM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: How to use the new iterate tag?
> > > 
> > > 
> > > Hello,
> > > 
> > > I'm using Struts-1.0-b2.
> > > 
> > > I'm trying to iterate over an array of objects using the 
> iterate tag
> > > as follows:
> > > 
> > >  > >collection = "<%= headers %>"
> > >type   = "some.class">
> > > 
> > > But I get an error like:
> > > 
> > > Attribute type invalid according to the specified TLD
> > > 
> > > And indeed it looks like the "type" attribute is not specified
> > > in the TLD, contrary to what the documentation says.
> > > When I try to drop the "type" attribute I see in the .java class
> > > that Tomcat defines "header" as a "java.lang.Object" and obviously
> > > fails later when I access class methods. I also tried to declare
> > > "header" using "useBean", but I get a "variable already defined"
> > > error.
> > > 
> > > Does anyone know what am I doing wrong?
> > > 
> > > Also, I read in the documentation that now the iteration tag
> > > exposes the current index number, can anyone show me how can
> > > I access this from a JSP page?  I couldn't find an example in
> > > the distribution.
> > > 
> > > Thanks,
> > > 
> > > --Amos Shapira
> > > 
> > 
> 



RE: How to use the new iterate tag?

2001-05-22 Thread Deadman, Hal

Type should be available as an attribute of the iterate tag. Which tld are you using? 
The tld and the documentation are generated from the same xml file so they shouldn't 
be out of sync. 

I think the iterate tag exposes the index for use by nested custom tags, but I don't 
know if any tags in struts make use of the exposed index. Maybe you have to write your 
own tag to access it?

Hal

> -Original Message-
> From: Amos Shapira [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 22, 2001 7:19 AM
> To: '[EMAIL PROTECTED]'
> Subject: How to use the new iterate tag?
> 
> 
> Hello,
> 
> I'm using Struts-1.0-b2.
> 
> I'm trying to iterate over an array of objects using the iterate tag
> as follows:
> 
> collection = "<%= headers %>"
>type   = "some.class">
> 
> But I get an error like:
> 
> Attribute type invalid according to the specified TLD
> 
> And indeed it looks like the "type" attribute is not specified
> in the TLD, contrary to what the documentation says.
> When I try to drop the "type" attribute I see in the .java class
> that Tomcat defines "header" as a "java.lang.Object" and obviously
> fails later when I access class methods. I also tried to declare
> "header" using "useBean", but I get a "variable already defined"
> error.
> 
> Does anyone know what am I doing wrong?
> 
> Also, I read in the documentation that now the iteration tag
> exposes the current index number, can anyone show me how can
> I access this from a JSP page?  I couldn't find an example in
> the distribution.
> 
> Thanks,
> 
> --Amos Shapira
> 



RE: LinkTag broken in May 11 build

2001-05-14 Thread Deadman, Hal

This should be fixed now.

> -Original Message-
> From: Vimal Kansal [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 11, 2001 11:08 PM
> To: [EMAIL PROTECTED]
> Subject: LinkTag broken in May 11 build
> 
> 
> Link tag seems to be broken. I have code snippet like
> this :
> 
>  name="tradingPartnerList"
> type="com.netfish.dm.TradingPartnerInfo">
>   
>  
>  page="/viewtradingpartner.do" paramId="tpName"
> paramName="tradingPartner" paramProperty="name"
> scope="request">
> name="tradingPartner" property="name"/>
> 
>  
>  
>  name="tradingPartner" property="desc">
> 
>  name="tradingPartner" property="desc"> 
> name="tradingPartner" property="desc"/> 
> 
>  
>  
>  name="tradingPartner" property="internalTPCode">
>  
> 
>  name="tradingPartner" property="internalTPCode">
> name="tradingPartner"
> property="internalTPCode"/> 
> 
>  
>  
>  name="tradingPartner" property="status">
>  
> 
>  name="tradingPartner" property="status">
>  name="tradingPartner" property="status"/> 
> 
>  
>   
>
> 
> 
> I get the following exception
> 
> at
> org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:436)
>   at
> org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:479)
>   at
> org.apache.struts.util.RequestUtils.computeParameters(RequestU
> tils.java:197)
>   at 
> org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:334)
> 
> __
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> 



RE: Urgent help needed

2001-05-11 Thread Deadman, Hal

Where is your struts.jar located? Have you modified your classpath at all? I
am not sure if struts-blank.war is meant to actually run out of the box. It
may just be shell to get started with. Does struts-example.war work for you?

> -Original Message-
> From: Vinod Shintre [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 11, 2001 2:46 PM
> To: [EMAIL PROTECTED]
> Subject: Urgent help needed
>
>
> can some1 tell me why am i getting this error & possible solution
> ---
> Internal Servlet Error:
>
> org.apache.jasper.compiler.CompileException:
> /home/vshintre/jakarta/jakarta-tomcat-3.2.1/webapps/struts-bla
> nk/login.jsp(3,2)
> Unable to load class org.apache.struts.taglib.html.FormTag
> at
> org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGene
> rator.java:129)
>
> ---
>
> thanx in advance
>
> vin
>
>
>



RE: Checkbox Arrays - Internationalising them?!

2001-05-11 Thread Deadman, Hal

Do you want bean:message to be able to get the key from a bean method? It
doesn't do that now...

Since  is printing the value of a bean property, your bean
property could use the MessageResources class to do the internationalization
in your bean method.

Inside an action you can get the MessageResource object and the Locale
object by calling these methods from the base Action class:

Locale locale = getLocale(request);
MessageResources messages = getResources();
messages.getMessage(locale,"some.key",args));

where args is an optional String array.

I am not sure how easy it would be for you to pass the messages and locale
objects into your bean and use them there.

Hal


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 11, 2001 2:37 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Checkbox Arrays - Internationalising them?!
>
>
>
>
> Hal,
>
> thanks for your input on multi-box - they are working great!
>
> BUT...I need to get the bean:write internationalized - does
> anyone know if this
> is possible?
>
> ie I want to do a bean:message on the output from a bean:write...
>
> I think this qu has been asked before, but I looked through
> the archives and
> couldn't find it...
>
> Thanks,
>
> Dave
>
>
>
>
>
> "Deadman, Hal" <[EMAIL PROTECTED]>
> on 05/10/2001
> 12:20:58 PM
>
> Please respond to [EMAIL PROTECTED]
>
> To:   [EMAIL PROTECTED]
> cc:(bcc: David Hay/Lex/Lexmark)
> Subject:  RE: Checkbox Arrays
>
>
>
> I posted this same response to your Posting Collections
> question yesterday.
> Here it is again. If you use the html:multibox, you can get
> back an array of
> key values instead of an array of booleans. They key values
> can be Longs,
> Strings, whatever, as long as it uniquely identifies the row
> that you want
> to know was checked. If you haven't used multibox, it
> generates an html
> checkbox. The array that will be set in your form will only
> contain the key
> values for the rows that were checked.
>
> Here is the post from yesterday:
>
> I think I am doing the same thing that you want to do using the
> html:multibox. When the form is submitted you get an array of
> the ids that
> are checked and then you can go delete them.
>
> in the jsp form (where restaurant id is a key for the item
> being deleted):
> 
> ...
>  
>   
>  
> ...
> 
>
>
> in the form class:
> private Long favoriteRestaurantRemoveList[] = new Long[0];
>
> public Long[] getFavoriteRestaurantRemoveList() {
> return (this.favoriteRestaurantRemoveList);
> }
>
> public void setFavoriteRestaurantRemoveList(Long
> favoriteRestaurantRemoveList[]) {
> this.favoriteRestaurantRemoveList =
> favoriteRestaurantRemoveList;
> }
>
> I am not sure if initializing the array to new Long[0] is necessary,
> probably not.
>
> > -Original Message-
> > From: Tony Karas [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 10, 2001 11:52 AM
> > To: Struts User
> > Subject: Checkbox Arrays
> >
> >
> > Can anyone help with this?
> >
> > I have an array of checkboxes in my ActionForm represented by
> >
> > boolean[] delete;
> >
> > and I have a setter function
> >
> > public void setDelete( boolean[] values )
> > {
> >delete = values;
> > }
> >
> > The problem is that I have only checkboxes that are checked
> > get sent back -
> > so if one checkbox is checked all I get is an array of length
> > 1.  Therefore,
> > it is not possible for me to determine which checkbox has
> > been checked.
> >
> > In the documentation it tells me to use reset() in ActionForm
> > to initialise
> > the values - but this will only work with single checkboxes
> > and not arrays.
> >
> > I think I'm stuck.  Is there anyway I can determine which
> > checkbox has been
> > checked - maybe I can get the value to differ for each
> > checkbox.  Will look
> > in to that.
> >
> > Cheers
> > Tony
> >
>
>
>
>
>
>



RE: Help needed extending BaseHandlerTag

2001-05-10 Thread Deadman, Hal

I think weblogic is masking the real error. Put a temporary try catch block
inside your html:form tag on the JSP to trap the real error. If the
exception is a ServletException, get the root exception

Hal

> -Original Message-
> From: Ariff Sidi [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 7:01 PM
> To: [EMAIL PROTECTED]
> Subject: Help needed extending BaseHandlerTag
>
>
> I want to create my own Radio button tag that's a slightly
> modified version
> of the struts RadioTag.
>
> So, I made a new class that extends BaseHandlerTag (just like
> RadioTag) and
> copied the RadioTag code to my new class (NewRadioTag).  I
> successfully
> compiled my new Tag and added it to my existing custom tld file.
>
> Now keep in mind that the code is EXACTLY the same as Struts' RadioTag
> except for a couple extra imports I had to make because the
> new package is
> different.
>
> I then modified the JSP file from using  to .
>
> The exception I get is:
>
> javax.servlet.ServletException: runtime failure in custom tag 'form'
> at
> jsp_servlet._jsp._supplier._company._companytype._jspService(_
> companytype.ja
> va:1097)
> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java
> :106)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java
> :124)
> at
> weblogic.servlet.internal.RequestDispatcherImpl.forward(Reques
> tDispatcherImp
> l.java:154)
> at
> org.apache.struts.action.ActionServlet.processActionForward(Ac
> tionServlet.ja
> va:1697)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.j
> ava:1540)
> at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java
> :106)
> at
> weblogic.servlet.internal.RequestDispatcherImpl.forward(Reques
> tDispatcherImp
> l.java:154)
> at
> com.zeborg.erfp.web.servlet.NavigationServlet.service(Navigati
> onServlet.java
> :113)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(Servle
> tStubImpl.java
> :106)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(Ser
> vletContextImp
> l.java:907)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(Ser
> vletContextImp
> l.java:851)
> at
> weblogic.servlet.internal.ServletContextManager.invokeServlet(
> ServletContext
> Manager.java:252)
> at
> weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketH
> TTP.java:364)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
>
>
>
>
> Why would this happen given that my new tag has IDENTICAL
> code to RadioTag,
> which works.  My platform is Weblogic 5.1SP8.
>



RE: My first

2001-05-10 Thread Deadman, Hal


http://jakarta.apache.org/struts
http://jakarta.apache.org/struts/userGuide/index.html
http://jakarta.apache.org/struts/installation.html
http://jakarta.apache.org/struts/installation-wls.html

Look in the struts distribution that you built:
src/example/*
dist/webapps/struts-example.war - example application
dist/webapps/struts-documentation.war - documentation

> -Original Message-
> From: Kiet Nguyen [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 3:07 PM
> To: '[EMAIL PROTECTED]'
> Subject: My first
> 
> 
> I'm trying to setup struts to work with weblogic51.  I build 
> the source code
> and trying to deploy a app.  I don't have any luck.  Is there 
> any app out
> there to help me going.  I want to be able to trace through 
> the framework.
> Is there any struts document out there..
> 
> thanks
> 
> 



RE: Philosophical question(s) related to STRUTS

2001-05-10 Thread Deadman, Hal

Struts has a bright future, as long as JSPs have a future. I don't think
Struts has any serious competition among JSP-centric MVC frameworks, but
Struts' fate is somewhat tied to that of JSPs. If you decide that you don't
like JSPs then there are lots of competitors to JSPs, mainly templating
languages like Velocity or XML focused solutions like Cacoon/XSP or (soon)
Microsoft WebForms. MS Webforms strikes me as a direct competitor of Struts
since they are both geared towards Webapps. (It's probably not MVC though?)

I personally like JSPs/Struts but it's good that there is competition out
there. I also think the different technologies work well for different types
of web-sites or even different parts of a site. I hope Struts continues to
open up to other non-JSP presentation frameworks. Struts works especially
well for Webapps. If you have a large brochure/informational site, it might
make sense to store that in XML and convert it to HTML in batch via XSLT.
There are probably other examples but I have only worked on a few web-sites
(none using XML).

One thing I have been wondering about recently, are we headed towards a
world where servers serve up XML and XSLT is done on the client? How does
JSP work in that kind of environment?

Webforms:
http://msdn.microsoft.com/vstudio/nextgen/technology/webforms.asp

You ask for thoughts, those are mine
Hal

> -Original Message-
> From: Mark Simms [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 12:44 PM
> To: [EMAIL PROTECTED]
> Subject: Philosophical question(s) related to STRUTS
>
>
> 1) Is SunMicro going to be supporting STRUTS from a financial and/or
> marketing standpoint ?
> I only saw one tiny, tiny mention of STRUTS in the JAVAONE outline of
> presentations I just got in the mail.
> That bothers me.
>
> 2) If the answer to #1 is unknown, will JSP/Java serverside
> professional
> developers take the time to learn STRUTS and employee it in their web
> applications ?
>
> 3) If the answer to #1 is unknown, will corporations and
> consulting firms
> decide to committ to STRUTS in lieu of their own frameworks
> and methodology
> ?
>
> I am wading thru the one-inch thick documentation and I must
> say I am really
> impressed with the work done so far.
> However, as a consultant, I must be concerned about spending
> too much time
> with this if it is not going to become a popular or
> sanctioned approach in
> the webdev marketplace.
>
> Thoughts / feedback anyone ?
>
>
>



RE: Checkbox Arrays

2001-05-10 Thread Deadman, Hal

Don't use the html:checkbox, use html:multibox and use bean:write in the
body of the tag. An html:multibox resolves to an HTML checkbox.

Hal

> -Original Message-
> From: Tony Karas [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 12:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Checkbox Arrays
>
>
> Yeah - I'm looking at that.  My problem now is how to get the
> value for each
> checkbox.  My bean has an "id" property - so I have tried
> this kind of
> thing:
>
> 
>   
>value=" name="retailer" property="id"/>"/>
>   
>   
>   
> 
>
> But it doesn't like having the bean:write embedded there.  Am
> I missing
> something obvious?
>
> Many thanks
> Tony
>
>
>
> >From: Peter Alfors <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >Subject: Re: Checkbox Arrays
> >Date: Thu, 10 May 2001 11:09:18 -0500
> >
> >Im not sure how the ActionForm changes things, but without
> an actionform
> >your
> >could do this
> >
> >Each checkbox can have the same name, but a different value.
> >When the form is submitted, the checkboxes that have been
> checked are in
> >the
> >request.
> >You can use the request.getParameterValues("checkBoxName")
> to retrieve a
> >string
> >array of the values for the checked boxes.
> >
> >HTH,
> > Pete
> >
> >Tony Karas wrote:
> >
> > > Can anyone help with this?
> > >
> > > I have an array of checkboxes in my ActionForm represented by
> > >
> > > boolean[] delete;
> > >
> > > and I have a setter function
> > >
> > > public void setDelete( boolean[] values )
> > > {
> > > delete = values;
> > > }
> > >
> > > The problem is that I have only checkboxes that are
> checked get sent
> >back -
> > > so if one checkbox is checked all I get is an array of length 1.
> >Therefore,
> > > it is not possible for me to determine which checkbox has
> been checked.
> > >
> > > In the documentation it tells me to use reset() in ActionForm to
> >initialise
> > > the values - but this will only work with single
> checkboxes and not
> >arrays.
> > >
> > > I think I'm stuck.  Is there anyway I can determine which
> checkbox has
> >been
> > > checked - maybe I can get the value to differ for each
> checkbox.  Will
> >look
> > > in to that.
> > >
> > > Cheers
> > > Tony
> ><< peter.alfors.vcf >>
>
> __
> ___
> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.



RE: Checkbox Arrays

2001-05-10 Thread Deadman, Hal

I posted this same response to your Posting Collections question yesterday.
Here it is again. If you use the html:multibox, you can get back an array of
key values instead of an array of booleans. They key values can be Longs,
Strings, whatever, as long as it uniquely identifies the row that you want
to know was checked. If you haven't used multibox, it generates an html
checkbox. The array that will be set in your form will only contain the key
values for the rows that were checked.

Here is the post from yesterday:

I think I am doing the same thing that you want to do using the
html:multibox. When the form is submitted you get an array of the ids that
are checked and then you can go delete them.

in the jsp form (where restaurant id is a key for the item being deleted):

...



...



in the form class:
private Long favoriteRestaurantRemoveList[] = new Long[0];

public Long[] getFavoriteRestaurantRemoveList() {
return (this.favoriteRestaurantRemoveList);
}

public void setFavoriteRestaurantRemoveList(Long
favoriteRestaurantRemoveList[]) {
this.favoriteRestaurantRemoveList = favoriteRestaurantRemoveList;
}

I am not sure if initializing the array to new Long[0] is necessary,
probably not.

> -Original Message-
> From: Tony Karas [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 11:52 AM
> To: Struts User
> Subject: Checkbox Arrays
>
>
> Can anyone help with this?
>
> I have an array of checkboxes in my ActionForm represented by
>
> boolean[] delete;
>
> and I have a setter function
>
> public void setDelete( boolean[] values )
> {
>   delete = values;
> }
>
> The problem is that I have only checkboxes that are checked
> get sent back -
> so if one checkbox is checked all I get is an array of length
> 1.  Therefore,
> it is not possible for me to determine which checkbox has
> been checked.
>
> In the documentation it tells me to use reset() in ActionForm
> to initialise
> the values - but this will only work with single checkboxes
> and not arrays.
>
> I think I'm stuck.  Is there anyway I can determine which
> checkbox has been
> checked - maybe I can get the value to differ for each
> checkbox.  Will look
> in to that.
>
> Cheers
> Tony
>



RE: Transactional Tokens in the JSP?

2001-05-10 Thread Deadman, Hal

It is saved in a hidden field in the form so it ends up in the request when
you submit.

> -Original Message-
> From: Allen Walker [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 11:40 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: Transactional Tokens in the JSP?
>
>
> At 10:57 AM 5/10/2001 +0200, Jean-Noel Ribette wrote:
> >Allen,
> >
> >You can set the transactional token in your edit Action class with
> >saveToken(request). Then you can test the token in
> >the submit action.
> >
> >I suggest you have a look at the classes EditRegistration and
> >SaveRegistration  in the example application.
>
> Yes, I checked that. But I am wondering how the token get's
> on the request
> from the jsp page itself.
>



RE: Logic iterate problems

2001-05-10 Thread Deadman, Hal

Have you tried this? It should work as long as whatever is in the Vector has
a method defined like: public String getName();






Put something like this at the top of your JSP just to make sure tabTest is
in there.
<%
Object obj = session.getAttribute("tabTest");
if (obj==null)
{
System.err.println("The action wasn't called before this jsp");
}
else
{
System.err.println("tabTest is a " + obj.getClass().getName());
}
%>


> -Original Message-
> From: Dudley Butt@i-Commerce [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 10, 2001 10:36 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Logic iterate problems
>
>
> i'll send u some code that u can adapt for Vectors that we used quite
> effectively with Arraylists, try it out...
>
> we used like a wrapper class to put our collection object in
> as follows:
>
>
> -
> package com.didata.itax.payment.web.data;
>
> import java.util.ArrayList;
>
> /**
>  * Title:
>  * Description:
>  * Copyright:Copyright (c) 2001
>  * Company:
>  * @author
>  * @version 1.0
>  */
>
> public class EFilerList {
> private ArrayList list = null;
> private int size = 0;
>
> public int getSize(){
> return list.size();
> }
>
> public EFilerList() {
> list = new ArrayList();
> }
> public EFilerList(ArrayList newList) {
> list = newList;
> }
> public void addEFiler(EFiler efiler){
> list.add(efiler);
> }
>
> public void removeEFiler(int eFilerID){
> list.remove(eFilerID);
> list.trimToSize();
> }
> public EFiler[] getEfilers(){//the iterate tags
> property="efilers" will
> call this method!!
> EFiler[] eFilers = new EFiler[list.size()];
> eFilers = (EFiler[])list.toArray(eFilers);
> return eFilers;
> }
>
>
> public EFiler getEfiler(int eFilerID){
> EFiler eFiler = new EFiler();
> eFiler = (EFiler)list.get(eFilerID);
> return eFiler;
> }
> }
>
> in your actionform or wherever u build the vector, use the
> above class to
> wrap your Vector, then, u push this list class above as your
> session object.
> This class is juts a wrapper, so we can access the ArrayList
> or Vector in
> our jsp. Once you've built EFilerList, put all the elements
> in it that u
> need, add it to the session   session.setAttribute...etc
>
>
> the jsp for the above example looks like this
>
>name="eFilerList" scope="session" property="efilers">
> 
>   
>  property="firstName" filter="true"/>
>   
>   
>  property="initials" filter="true"/>
>   
>   
>  property="lastName" filter="true"/>
>   
>   
>  property="idNumber"/>
>   
>   
>  property="state"/>
>   
>
>   
>page="/eFilerEdit.do?action=Edit" > key="eFilerList.edit"/>/html:link>
>   
>   
>  property="state"/>
>   
>
> 
>   
>
>
> the eFiler class looks like this.
>
>
> package com.didata.itax.payment.web.data;
>
> import com.didata.itax.payment.web.actionform.*;
>
> /**
>  * Title:
>  * Description:
>  * Copyright:Copyright (c) 2001
>  * Company:
>  * @author
>  * @version 1.0
>  */
>
> public class EFiler implements java.io.Serializable {
>
> String firstName = null;
> String initials = null;
> String lastName = null;
> String idNumber = null;
> Boolean state = new Boolean(false);
>
> public EFiler() {
>
> }
>
> public EFiler(EFilerActionForm eFilerForm) {
> firstName = eFilerForm.getFirstName();
> initials = eFilerForm.getInitials();
> lastName = eFilerForm.getLastName();
> idNumber = eFilerForm.getIdNumber();
> state = eFilerForm.getState();
> }
>
>public Boolean getState(){
>  return state;
>}
>
>public void setState(Boolean _state){
>   this.state = _state;
>}
>   public String getFirstName(){
>   return firstName;
>   }
>   public void setFirstName(String firstName){
>   this.firstName = firstName;
>   }
>   public String getInitials(){
>   return initials;
>   }
>   public void setInitials(String initials){
> 

RE: Logic iterate problems

2001-05-10 Thread Deadman, Hal



I 
don't think you need the jsp:useBean. You also don't need type="Client". If you 
want to use type, make sure the class is fully qualified with the package it's 
in. 

  -Original Message-From: Sylvain FAGNENT 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, May 10, 2001 9:33 
  AMTo: [EMAIL PROTECTED]Subject: Re: Logic 
  iterate problems
  I tried, here is the code in my action 
  :
   
   tabTest= new 
  Vector(); test = new 
  Client(); test.setName("Tata 
  DUBAR"); tabTest.add(test); test 
  = new 
  Client(); test.setName("SFA"); tabTest.add(test);
   session.setAttribute("tabTest",tabTest);
   
  And the JSP code :
   
       
   
  I still have my "cannnot find client bean " 
  error.
   
  Thanks Sylvain !
  
- Original Message - 
From: 
Nanduri, Amarnath 
To: '[EMAIL PROTECTED]' 

Sent: Thursday, May 10, 2001 3:17 
PM
Subject: RE: Logic iterate 
problems

Maybe use need to use the  
in 
your jsp page. Give it a shot and let me know...
 
cheers,
Amar..

  -Original Message-From: Sylvain FAGNENT [mailto:[EMAIL PROTECTED]]Sent: 
  Thursday, May 10, 2001 9:13 AMTo: [EMAIL PROTECTED]Subject: 
  Re: Logic iterate problems
  Yes , we did ! :-(
  
- Original Message - 
From: 
Dudley Butt@i-Commerce 

To: '[EMAIL PROTECTED]' 

Sent: Thursday, May 10, 2001 3:04 
PM
Subject: RE: Logic iterate 
problems

have u put that object into the session, before 
u get to the form
 
session.setAttribute("tabTest", 
VectorObject);

  -Original Message-From: Sylvain FAGNENT [mailto:[EMAIL PROTECTED]]Sent: 
  Thursday, May 10, 2001 2:57 PMTo: [EMAIL PROTECTED]Subject: 
  Logic iterate problems
  Hello,
   
  I have a Vector Object stored in my 
  session with the key "tabTest" this Vector contains "Client" 
  Objetcs, Client classe have a "name" property.
   
  I use this code in my JSP :
   
      
  
   
  This error is return :
   
  ...JSP Exception : Cannot find bean 
  client in scope null
   
  any help...Thanks
   
  Sylvain


RE: Posting Collections

2001-05-09 Thread Deadman, Hal

I think I am doing the same thing that you want to do using the
html:multibox. When the form is submitted you get an array of the ids that
are checked and then you can go delete them.

in the jsp form (where restaurant id is a key for the item being deleted):

...



...



in the form class:
private Long favoriteRestaurantRemoveList[] = new Long[0];

public Long[] getFavoriteRestaurantRemoveList() {
return (this.favoriteRestaurantRemoveList);
}

public void setFavoriteRestaurantRemoveList(Long
favoriteRestaurantRemoveList[]) {
this.favoriteRestaurantRemoveList = favoriteRestaurantRemoveList;
}

I am not sure if initializing the array to new Long[0] is necessary,
probably not.

> -Original Message-
> From: Tony Karas [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 09, 2001 12:50 PM
> To: [EMAIL PROTECTED]
> Subject: Posting Collections
>
>
> Briefly, this is what I am trying to achieve:
>
> - Retrieve a list of items from a database
> - Display each item with a corresponding checkbox
> - Display a "Delete" button - which when pressed deletes all
> checked items.
>
> Unfortunately, although I have managed to display the items
> correctly and
> set the checkbox value using boolean values, when I do the
> form submit - my
> ActionForm properties do not get filled in.
>
> This is the code I have:
>
> My ActionForm looks like this:
>
> public class RetailerForm extends ActionForm
> {
> protected Vector retailer;
>
> /*
>  * On construction, fill the form with all the retailers
>  */
> public RetailerForm() throws SQLException
> {
>  //here i have some code to generate my vector
>  //which is comprised of "Retailer" beans.
> }
>
> public Retailer getRetailer( int index )
> {
> return (Retailer)retailer.elementAt( index );
> }
>
> public Vector getRetailer()
> {
> return retailer;
> }
>
> public void setRetailer( Vector value )
> {
> retailer = value;
> }
> }
>
> My "Retailer" bean has get and set elements for properties
> called "delete"
> and "name".
>
> My struts code looks like this (obviously within  tags):
>
> 
>   
>   
>   
>   
> 
>
> And this all works ok for displaying the data.  However, when
> I do the
> submit my "delete" property for each bean is not set and I have added
> debugging code to the "set" method and this is not called by
> struts.  I
> don't get error messages - it just doesn't happen.
>
> I know other people have had this problem, but I am
> struggling to find a
> solution.
>
> Can anyone help me?  Is there a better way of achieving what
> I am trying to
> achieve?  If I am doing the correct thing, what's the reason it's not
> working.
>
> All help appreciated.
>
> Cheers
> Tony
> __
> ___
> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.



RE: Struts forms and JSP components/templates

2001-05-07 Thread Deadman, Hal

I think the change from page to request was alread made for html:form. Get
the latest Struts from CVS.

Hal

> -Original Message-
> From: Tim Moore [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 5:40 PM
> To: '[EMAIL PROTECTED]'
> Subject: Struts forms and JSP components/templates
>
>
> I'm working on a very complex webapp with hundreds of form
> pages. Frequently
> there are "chunks" of a form that are shared across several
> pages. I was
> hoping to use the components library to separate these common
> form chunks
> into reusable pages, but I'm not having much luck with this.
>
> The problem is that the struts html:form tag stores data in
> the PageContext
> of the enclosing page, where individual input tags that
> appear in the the
> included components are unable to access them. I don't know if there's
> anything I can do about this from my application's end.
>
> Does anyone have any suggestions...hopefully something other
> than "don't do
> that!" ;-)
>
> Would it make any sense to change html:form to use the request context
> rather than the page context?
>
> TIA,
> --
> Tim Moore / Blackboard Inc. / Software Engineer
> 1899 L Street, NW/ 5th Floor / Washington, DC 20036
> Phone 202-463-4860 ext. 258 / Fax 202-463-4863
>



RE: Potential Security Flaw in Struts MVC

2001-05-07 Thread Deadman, Hal



It's 
fine to nest a JavaBean in an ActionForm if that bean is just a transport object 
that is passed to EJBs but it probably isn't a good idea to nest your model 
objects directly in the form. 
 
If you 
are going to nest a javabean in a form you don't need the getName()/setName() 
methods, you can just have a getUser()/setUser() and reference the properties of 
the nested bean by labeling the field in your jsp as 
"user.name".
 
Hal

  -Original Message-From: Jeff Trent 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, May 07, 2001 5:09 
  PMTo: [EMAIL PROTECTED]Subject: Re: 
  Potential Security Flaw in Struts MVC
  Ah, this maybe a problem in the way I've adapted 
  Struts.  I reflect all UserForm method calls directly into the contained 
  User object owned by the UserForm.  So for instance, I have
   
  public class UserForm extends 
  ActionsForm
  {
      protected User 
  user;
   
      ...
   
      public String 
  getName()
      {
          return 
  user.getName();
      }
   
      public void setName(String 
  name)
      {
          
  user.setName(name);
      }
   
      ...
   
  }
   
  Now can you begin to see my original 
  concern?  Maybe I need to separate the model from the form a little more 
  than what I have.
   
  - jeff
   
  
- Original Message - 
From: 
Bryan 
Field-Elliot 
To: [EMAIL PROTECTED] 

Sent: Monday, May 07, 2001 4:38 
PM
Subject: Re: Potential Security Flaw in 
Struts MVC
Either you are misunderstanding Struts, or I am 
misunderstanding you.Struts will populate your UserForm for you, 
prior to your UserAction being called. However, it is your responsibility 
to, within UserAction, copy the values from UserForm to 
User.BryanJeff Trent wrote:
00bd01c0d728$40864960$6401a8c0@PROVIDENCE">
  
  Bryan,
   
  This is good advice.  However, I thought 
  the beans are populated off of the request outside of the control of my 
  Action class derivation.  Therefore, copyProperties() doesn't 
  pertain.
   
  - jeff
  
- 
Original Message - 
From: 
Bryan Field-Elliot
To: 
[EMAIL PROTECTED]
Sent: 
Monday, May 07, 2001 1:14 PM
Subject: 
Re: Potential Security Flaw in Struts MVC
There is a security risk here as you describe, if (and 
only if) you are using a generic introspection-based function (like 
Struts' PropertyUtils.copyBean) to copy the values from the UserForm 
object to the User object. There are several ways to avoid this 
--1. Don't put an admin flag "setter" method in your User 
class.2. In UserAction, don't use the generic bean copy utility -- 
instead, manually copy the values, excluding the admin flag.3. As a 
smarter alternative to #2, don't use a generic bean copy utility -- 
instead, write an intelligent copy function in the User class, which 
"knows" that it's copying FROM a UserForm, TO a User, and therefore, 
skip the copying of the Admin flag.BryanJeff 
Trent wrote:
002501c0d70b$9df009a0$6401a8c0@PROVIDENCE">
  
  

  I may be wrong about this (only been 
  working w/ Struts for a week now).  But I do see a potential 
  security flaw in struts that I would like to hear from others 
  regarding.
   
  Consider a simple set of struts classes 
  that represent a user in a system. You would probably have classes 
  that look something like this:
      User    
              (the model 
  representing the user)
      
  UserForm        (an enrollment form for 
  a new user)
      
  UserAction        (Saves the UserForm 
  information to db, etc)
      
  The User class would have accessors and 
  modifiers like getFirstName(), setFirstName(), 
  getAdministrativeUserFlag(), setAdministrativeUserFlag(), etc.  
  The basic implementation of the UserForm is to take the UI form data, 
  introspect the beans, and call the correct modifier of the UserForm 
  bean based on the fields contained within the UI 
  submission/form.  A developer of course would not expose the 
  "Administrative User Flag" option on the UI for enrollment (that would 
  be found possibly in some other administrative-level module).  
  However, if someone is familiar with the db schema and the naming 
  convention the developer used, that user could subvert the application 
  by writing his own version of the UI which contains an "Administrative 
  User Flag" field (or any other field for that matter) and the basic 
  form processing in Struts will kindly honor the request and set the 
  "Administrative Flag" on th

RE: struts newbie trying to get onboard

2001-05-04 Thread Deadman, Hal

Is the struts ActionServlet configured and starting up OK?  You should not
be using struts-form.tld either, it's deprecated. If you are using Struts
0.5, don't, use the Struts 1.0 beta.

> -Original Message-
> From: Procek, Brett [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 04, 2001 12:56 PM
> To: [EMAIL PROTECTED]
> Subject: struts newbie trying to get onboard
>
>
> Hello all, this is my first posting.  I'm trying to get onboard here
> with one of those simple login
> application I'm sure you've all seen.  I've spent some time trying to
> get this to work.
> I went through all steps to install struts on my workstation
> for Tomcat
> 3.2.1 and verified them several times. I even have the struts-example
> application working, so I've come a little ways already.
>
> I'm using the sample login.jsp that one can find almost
> anywhere, but I
> keep getting the same exception:
>
> -
> Root cause:
> javax.servlet.jsp.JspException: Cannot find ActionMappings or
> ActionFormBeans collection
>   at
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:703)
>   at
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:441)
>   at
> _0002flogin_0002ejsplogin_jsp_1._jspService(_0002flogin_0002ej
> splogin_js
> p_1.java:71)
>
> -
>
> I'm sure my taglibs are set up correctly, and I do have the struts.jar
> file appended to the classpath.
> Any help would be appreciated.
> Thanks,
> Brett
>
>
>
> Here is the login.jsp file:
> 
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
>
>   
>
>   Username: 
>
>   Password: 
>
>   
>   
> -
>
>



RE: Load Testing

2001-04-23 Thread Deadman, Hal

The jmeter list said something about that being fixed in the CVS version. 

>From the jmeter list:

This is the case in JMeter 1.5.  In 1.6, the alpha release doesn't allow
alternate ports.  However, it has been fixed in cvs.

-Mike

On Monday 09 April 2001 19:07, you wrote:
> Yep, you just have to specify the port # in the URL, like this:
> http://localhost:8080/, the browser chooses 80 by default unless you tell
> it which port to look at.
>
> --
end of snippet from jmeter list

> -Original Message-
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 23, 2001 4:28 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Load Testing
> 
> 
> Were you able to get that running with an alternate port, like 8080 ?
> 
> "Deadman, Hal" wrote:
> > Microsoft has a free stress test tool too:
> > http://homer.rte.microsoft.com/
> 



RE: Load Testing

2001-04-23 Thread Deadman, Hal

I assume you have you looked at Jmeter? http://jakarta.apache.org/jmeter I
haven't used it yet. I am not sure how easy it is to generate load that
consists of dynamically generated data for form submissions and the like.

Microsoft has a free stress test tool too:
http://homer.rte.microsoft.com/



> -Original Message-
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 23, 2001 12:48 PM
> To: [EMAIL PROTECTED]
> Subject: Load Testing
>
>
> I need to do some load testing on a Struts application, and
> wondered if
> anyone had any war stories to share, or recommendations as to the best
> approach.
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>



RE: Writing complicated HTML with embedded bean data

2001-04-19 Thread Deadman, Hal

You can use the html:link tag to pass parameters. The example shows how to
pass a single parameter, there is another method involving a Map that lets
you pass multiple key/value pairs as parameters.


  



  


> -Original Message-
> From: Stephen Schaub [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 19, 2001 9:40 AM
> To: [EMAIL PROTECTED]
> Subject: Writing complicated HTML with embedded bean data
>
>
> I'm rather new to Struts, and have done quite a bit of
> reading, but am just now getting down to some experimental
> development.
>
> One of the issues I'm trying to deal with is how to generate
> things like HTML links without resorting to embedding
> scriptlets.
>
> For example, let's say that I have a bean named 'product'
> with two properties: id and title. I would like to generate
> a link like this:
>
> 
>   
> 
>
> I don't want to resort to using a scriptlet to get the
> product id embedded in the link. So far the only solution
> I've seen is in the struts-example app, which uses a custom
> tag in a similar situation to avoid the scriptlet approach.
> That seems like overengineering to me (or maybe I'm just too
> lazy).
>
> It seems to me that the  tag might be easily
> adapted to solve this problem. I would like to be able to do
> something like this:
>
> In ApplicationResources, define the following:
>
> product.link={1}
>
> Then, in the jsp file:
>
>  arg1="{product.title}"/>
>
> I'm using { } in the arg attributes to indicate that the
> text of the argument should be retrieved from the bean using
> the struts property evaluation system.
>
> What think ye?
>
> Stephen Schaub
>



RE: Confusion with form beans

2001-04-11 Thread Deadman, Hal

I am not sure what the default is but you should specify redirect="false" if
you are passing things on the request object. That will cause a forward
instead of a redirect. If the default for redirect is true then the
/ShowLog.do action will be requested with a new request. 



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 11, 2001 6:02 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Confusion with form beans
> 
> 
> 
> 
> Craig,
> 
> Thanks for that.  I'd been passing stuff as session var's, 
> but grabbing the next
> page's form is much cleaner.
> 
> Having problems getting it working though - seems to be 
> creating a blank new
> form in the action I forward to.
> 
> In the action after the first page is submitted, I did the following:
> 
>   //set parameters we need for next page in it's form bean
>   LogForm logForm = new LogForm();
>   logForm.setFilename(filename);
>   logForm.setEntryPoints(entryPoints);
>   //add in request scope
>   request.setAttribute("LogForm", logForm);
> 
>   // Forward control to the parameters page
>   return(mapping.findForward("success"));
> 
> (have in struts_config:path="/ShowLog.do" />
>   for this action)
> 
> However, when I grab the form that I get in the 
> ShowLogAction, it seems to
> create a new blank form.  If I actually get
> the form from the request object by doing
>  LogForm myLogForm = (LogForm) request.getAttribute("LogForm");
> I do get the form I created!  The name of the form in 
> struts-config is LogForm -
>  so don't understand it.
> 
> Any ideas?
> 
> Dave
> 
> 
> 
> 
> 
> "Craig R. McClanahan" 
> <[EMAIL PROTECTED]> on 04/09/2001
> 10:47:46 PM
> 
> Please respond to [EMAIL PROTECTED]
> 
> To:   [EMAIL PROTECTED]
> cc:(bcc: David Hay/Lex/Lexmark)
> Subject:  RE: Confusion with form beans
> 
> 
> 
> 
> 
> On Wed, 4 Apr 2001 [EMAIL PROTECTED] wrote:
> 
> >
> >
> > Nigel,
> >
> > Hi.  Just to confirm...I would really like to have access 
> to the first form in
> > the action that creates the second form.  Can I do that, or 
> do I have to pass
> > the info in as parameters?  ie will the first bean PERSIST 
> in the session so I
> > can access it in the following action?  It seems that the 
> persisting way is
> much
> > cleaner.
> >
> > Please let me know if that doesn't make sense!!
> >
> > Dave
> >
> 
> I *think* the following approach is what you are asking for:
> 
> * Two forms, "form1.jsp" and "form2.jsp".
> 
> * Each form has an associated bean ("form1Bean" and "form2Bean").
> 
> * Have the "form1.jsp" page submit to an action "/saveForm1".
> 
> * The corresponding Action for "/saveForm1" can then:
>   - Receive the form1Bean bean that contains the form1.jsp fields
>   - Create a new form2Bean instance, and store it in request scope
>   - Forward to "form2.jsp"
> 
> * Now, the bean for "form2.jsp" will be pre-initialized, based on
>   whatever processing was done by the Action.  This can, of course,
>   including things like copying values from the form1Bean instance.
> 
> Craig McClanahan
> 
> 
> 
> 
> 
> 
> 



RE: Problem with bean:struts tag

2001-04-09 Thread Deadman, Hal

I think bean:struts is used to access configuration information from
struts-config.xml. Are you trying to use it to access the properties of a
particular form instance? You can do that with bean:write directly if the
form is already in some scope. 

Hal
> -Original Message-
> From: Trevor Griffiths [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 7:12 PM
> To: [EMAIL PROTECTED]
> Subject: Problem with bean:struts tag
> 
> 
> Hi,
> 
> I am trying to use the bean:struts and bean:write tags to 
> expose(copy) an
> action form bean and print a property.  However when I use 
> the bean:write
> tag it tells me that there is no getter method for the specified
> property(helloMessage).
> As can be seen in the code below, directly before the bean tags I have
> successfully used the form bean inside the form tags and it prints the
> specified property with no problems. That is: There is a 
> gettter method for
> this particular form bean property, and it works).
> I have assumed that I need to first expose(copy) the form bean with
> bean:struts and then write the property with bean:write. Is 
> this incorrect?
> What am I doing wrong?
> 
> Here is the jsp fragment in question:
> 
> 
> 
>   
> 
> 
> 
> 
> 
> 
> 
> The form bean xml mapping is:
> 
> 
> Thanks
> 
> Trev...
> 



RE: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts

2001-04-09 Thread Deadman, Hal

What's the error that you are getting?

> -Original Message-
> From: Lu, Wei [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 1:08 PM
> To: '[EMAIL PROTECTED]'
> Subject: Problems in setting up Weblogic5.1 + SP8 + Jakarta-Struts
> 
> 
> Hello, 
> 
> I got in trouble in setting up Weblogic5.1 + SP8 + Jakarta-Struts.  I
> followed  the instruction 
> in the INSTALL file and tried to deploy struts-example.war.  
> But I failed.
> Could anybody tell me where I should put 
> that ApplicationResources.properties file? The INSTALL file 
> said it should
> be at C:\jakart-struts\webapps\WEB-INF\_tem_war,
> but it seems to be not to work. 
> 
> Thank you. 
> 
> Wei Lu
> 



RE: select tag attribute disable

2001-04-09 Thread Deadman, Hal

Your best bet is to display static text for the existing entries because I
doubt HTML supports disabling a select box. You would probably need to use
Javascript to prevent someone from changing a select option but that would
be annoying. If they can't change something, why put it in a select box?

Hal

> -Original Message-
> From: Joel Schmidt [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 12:55 PM
> To: [EMAIL PROTECTED]
> Subject: select tag attribute disable
> 
> 
> Hi,
> I'm using a form using struts and the struts-html tag library 
> and a select
> tag. When I'm editing an entry in the form I want to disable 
> the select box
> while still displaying it with what's selected and have it 
> enabled when
> creating a new entry. I would have thought simply inserting 
> the attribute
> something like this would work but it doesn't.
>  
> 
> 
> Any suggestions?
>  Joel Schmidt
> 
>  Apex Learning
>  Phone 425.468.6790
>  Ext 6790
>  Email [EMAIL PROTECTED]
> 



RE: Visualage Java 3.5 with tomcat and struts

2001-04-06 Thread Deadman, Hal

>From what I hear, Tomcat 3.1 is not really supported by Struts, Tomcat 3.2
is.

> -Original Message-
> From: Wes Cummings [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 06, 2001 4:19 PM
> To: Struts-User
> Subject: Visualage Java 3.5 with tomcat and struts
> 
> 
> hi,
> I am trying to get struts to run in VAJ3.5 pacth 2. I have 
> tomcat running
> fine. The version of tomcat is 3.1. The version of struts is 
> 1.0-beta-1. In
> stepping thru with the debugger, it appears to get the error 
> when trying to
> load org.apache.struts.digester.Digster. I have all Struts 
> classes loaded in
> VisualAge and have added the Struts project to the 
> TomcatRunner properties.
> I have tried adding the struts.jar to TomcatRunner's 
> classpath as well with
> know luck. Any help at all would be most appreciated.
> 
> Thanks in advance,
> 
> Wes Cummings
> 
> I get the following error when tomcat is starting up:
> 
> Context log path="/struts-example" :tomcat.errorPage: init
> Context log: path="/struts-example" XmlReader - init  /struts-example
> webapps/struts-example
> Context log: path="/struts-example" Reading
> E:\VAJ\ide\project_resources\Apache_Tomcat_Test_Environment\co
> nf\web.xml
> Context log: path="/struts-example" Reading
> E:\VAJ\ide\project_resources\Apache_Tomcat_Test_Environment\we
> bapps\struts-e
> xample\WEB-INF\web.xml
> Context log: path="/struts-example" Loading -2147483646 jsp
> Context log path="/struts-example" :jsp: init
>  Fri Apr 06 12:38:25 PDT 2001 Parent class loader is:
> org.apache.tomcat.loader.AdaptiveServletLoader@78c7
> Context log: path="/struts-example" Loading -2147483646 default
> Context log path="/struts-example" :default: init
> Context log: path="/struts-example" Loading 1 database
> Context log path="/struts-example" :database: init
> Context log path="/struts-example" :database: Initializing 
> database servlet
> Context log path="/struts-example" :database: Loading database from
> '/WEB-INF/database.xml'
> Exception occurred:  null
> java.lang.reflect.InvocationTargetException: 
> java.lang.InternalError: (Ex02)
> An error has occurred.
>   java.lang.Throwable(java.lang.String)
>   java.lang.Error(java.lang.String)
>   java.lang.VirtualMachineError(java.lang.String)
>   java.lang.InternalError(java.lang.String)
>   void org.apache.struts.example.DatabaseServlet.load()
>   void org.apache.struts.example.DatabaseServlet.load()
>   void org.apache.struts.example.DatabaseServlet.init()
>   void 
> javax.servlet.GenericServlet.init(javax.servlet.ServletConfig)
>   void org.apache.tomcat.core.ServletWrapper.initServlet()
>   void org.apache.tomcat.core.ServletWrapper.loadServlet()
>   void
> org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit
> (org.apache.to
> mcat.core.Context)
>   void
> org.apache.tomcat.core.ContextManager.initContext(org.apache.t
> omcat.core.Con
> text)
>   void org.apache.tomcat.core.ContextManager.init()
>   void 
> org.apache.tomcat.startup.Tomcat.execute(java.lang.String [])
>   void org.apache.tomcat.startup.Tomcat.main(java.lang.String [])
>   java.lang.Object 
> java.lang.reflect.Method.invoke(java.lang.Object,
> java.lang.Object [])
>   void 
> com.ibm.ivj.tomcat.TomcatRunner.startTomcat(java.lang.String)
>   void
> com.ibm.ivj.tomcat.TomcatRunner.actionPerformed(java.awt.event
> .ActionEvent)
>   void 
> java.awt.Button.processActionEvent(java.awt.event.ActionEvent)
>   void java.awt.Button.processEvent(java.awt.AWTEvent)
>   void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
>   void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
>   void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
>   boolean java.awt.EventDispatchThread.pumpOneEvent()
>   void 
> java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
>   void java.awt.EventDispatchThread.run()
> 



RE: how to get a global ActionForward object?

2001-04-06 Thread Deadman, Hal

Yes

> -Original Message-
> From: JeanX [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 06, 2001 3:56 AM
> To: struts-user
> Subject: how to get a global ActionForward object?
> 
> 
> Hi struts-user,
> 
> How to get a global ActionForward object defined in 
>  tag in my Action class ?
> Can I get it by calling findForward() on the ActionMapping 
> object I received?
> Thx
> 
> :=)
> Best regards,
> JeanX
> pacificnet.com(GZ)
> 



RE: how to access related ActionForm from within .jsp?

2001-04-05 Thread Deadman, Hal

You are using redirect="false", correct? It shouldn't matter what type is
used when the action form is put in the request. setAttribute takes an
Object so you can put anything in there but it will actually be the type of
the form bean specified in struts-config.xml. Can you submit the section of
the struts-config.xml file that contains the actions you are using? There
should be one action that forwards to the jsp with a redirect=false. There
should be another action that your jsp submits to. Both actions should use
the same form. You may want to submit part of the jsp that tries to access
the form bean. 

Hal

> -Original Message-
> From: Scott Cressler [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 3:58 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: how to access related ActionForm from within .jsp?
> 
> 
> I was just looking at this code to try to figure out my 
> problem (Problem
> finding classes after forward (resend)).  I have learned some things,
> although I wouldn't say I really understand all of them, yet.
> 
> When you go into the ActionServlet and are being directed to 
> an Action, if
> there is a formbean associated with the action (the "name=" 
> attribute of the
> action tag in the struts-config.xml file), the ActionServlet 
> will try to get
> such a named object from the request.  If it doesn't find it, 
> it creates an
> instance of the class you specified in the form-bean tag (also in the
> struts-config.xml file) and then puts it in the request under 
> the name you
> specified in the action tag.  So, theoretically, you should 
> just be able to
> pull it out of the request in your .jsp file and use it, either using
>  or scriptlet code that uses request.getAttribute().
> 
> Okay, here's the bad news...it doesn't work for me.  I found 
> that the reason
> it doesn't work is that the ActionServlet code is referring 
> to the formbean
> object as an ActionForm at the time that it puts it into the 
> request.  I'm
> not sure why, but when you take it out, using one of the 
> above techniques,
> it can only be cast to be an ActionForm!  The reason the 
>  tags, like
> , work is because they don't try to cast to your 
> class.  Instead,
> they use introspection to call the getter for the property.
> 
> It may be possible to use the  tags to access that 
> bean, but our ISP
> is currently having problems, so I can't check  :-(
> 
> Does anyone else think this is a problem?  Shouldn't I be able to do a
>  on a bean that is my class?  For example, I 
> (like Daniel?)
> need to get data out of the bean outside of the  
> context (e.g.,
> to display the user's name when editing the address)?
> 
> BTW, I may have some configuration problem that is making 
> this not work for
> me...so it might work for you.  I'm going to try something 
> else and will
> report if it works.
> 
> Scott
> 
> > -Original Message-
> > From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 05, 2001 12:11 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: how to access related ActionForm from within .jsp?
> > 
> > 
> > The form bean is associated with an action, not a jsp. The 
> > jsp may contain
> > an html:form which references an action, thereby gaining 
> > access to the form
> > associated with that action. A jsp could have multiple html:forms. 
> > 
> > The form bean associated with the action is available in 
> > request scope for
> > the jsp but I don't know how you would get access to it 
> > without using the
> > name of the form. Is there a struts tag that will get 
> > actionmapping values
> > when given the name of the action? That would allow you to 
> > get the form bean
> > name using the same action used by the html:form. 
> > 
> > Maybe you could use the bean:struts tag to get the action 
> > mapping and then
> > get the form from that. 
> > 
> > Hal
> > 
> > > -Original Message-
> > > From: Daniel Toms [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, April 05, 2001 2:50 PM
> > > To: Struts-User
> > > Subject: how to access related ActionForm from within .jsp?
> > > 
> > > 
> > > I am having a common problem all over the place.
> > > Struts allows you to associate a bean(the ActionForm)
> > > with a given .jsp.  It then magically gets and sets
> > > input fields for you.  Great.
> > > 
> > > But all of the other struts tags require a reference
> > >

RE: how to access related ActionForm from within .jsp?

2001-04-05 Thread Deadman, Hal

Let me ammend my comment. The formbean will only be available in the jsp if
the action that forwards to that jsp specifies the form when it is defined
in struts-config.xml. Otherwise the formbean isn't created until the jsp
submits to the action that is defined as having the form. 

> -Original Message-
> From: Deadman, Hal 
> Sent: Thursday, April 05, 2001 3:11 PM
> To: [EMAIL PROTECTED]
> Subject: RE: how to access related ActionForm from within .jsp?
> 
> 
> The form bean is associated with an action, not a jsp. The 
> jsp may contain
> an html:form which references an action, thereby gaining 
> access to the form
> associated with that action. A jsp could have multiple html:forms. 
> 
> The form bean associated with the action is available in 
> request scope for
> the jsp but I don't know how you would get access to it 
> without using the
> name of the form. Is there a struts tag that will get 
> actionmapping values
> when given the name of the action? That would allow you to 
> get the form bean
> name using the same action used by the html:form. 
> 
> Maybe you could use the bean:struts tag to get the action 
> mapping and then
> get the form from that. 
> 
> Hal
> 
> > -Original Message-
> > From: Daniel Toms [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 05, 2001 2:50 PM
> > To: Struts-User
> > Subject: how to access related ActionForm from within .jsp?
> > 
> > 
> > I am having a common problem all over the place.
> > Struts allows you to associate a bean(the ActionForm)
> > with a given .jsp.  It then magically gets and sets
> > input fields for you.  Great.
> > 
> > But all of the other struts tags require a reference
> > to a bean by name, using the name="foo" argument
> > to the tag.
> > 
> > My problem is, I want to reference the bean associated
> > with my jsp, so that when I want to iterated over a collection
> > it contains, I can do so without having to know the bean's name.
> > 
> > example:
> > 
> > 
> > public final class FooForm extends ActionForm
> > {
> > public Collection bar;
> > 
> > public Collection getBar()
> > {
> > return bar;
> > }
> > 
> > public void setBar(Collection b
> > {
> > this.bar = b;
> > }
> > }
> > 
> > then in my jsp:
> > 
> >   
> > 
> > 
> >property="propertyName"/>
> >   
> >property="propertyValue"/>
> >
> > 
> > 
> > So the iterate tag doesn't work because it wants a bean by 
> > name, but is
> > there something I haven't gotten that will make struts use the bean 
> > associated with the jsp and not one specified by name?  
> > 
> > thanks,
> > 
> > dan
> > 
> 



RE: how to access related ActionForm from within .jsp?

2001-04-05 Thread Deadman, Hal

The form bean is associated with an action, not a jsp. The jsp may contain
an html:form which references an action, thereby gaining access to the form
associated with that action. A jsp could have multiple html:forms. 

The form bean associated with the action is available in request scope for
the jsp but I don't know how you would get access to it without using the
name of the form. Is there a struts tag that will get actionmapping values
when given the name of the action? That would allow you to get the form bean
name using the same action used by the html:form. 

Maybe you could use the bean:struts tag to get the action mapping and then
get the form from that. 

Hal

> -Original Message-
> From: Daniel Toms [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 2:50 PM
> To: Struts-User
> Subject: how to access related ActionForm from within .jsp?
> 
> 
> I am having a common problem all over the place.
> Struts allows you to associate a bean(the ActionForm)
> with a given .jsp.  It then magically gets and sets
> input fields for you.  Great.
> 
> But all of the other struts tags require a reference
> to a bean by name, using the name="foo" argument
> to the tag.
> 
> My problem is, I want to reference the bean associated
> with my jsp, so that when I want to iterated over a collection
> it contains, I can do so without having to know the bean's name.
> 
> example:
> 
> 
> public final class FooForm extends ActionForm
> {
>   public Collection bar;
> 
>   public Collection getBar()
>   {
>   return bar;
>   }
> 
>   public void setBar(Collection b
>   {
>   this.bar = b;
>   }
> }
> 
> then in my jsp:
> 
>   
> 
> 
>   
>   
>   
>
> 
> 
> So the iterate tag doesn't work because it wants a bean by 
> name, but is
> there something I haven't gotten that will make struts use the bean 
> associated with the jsp and not one specified by name?  
> 
> thanks,
> 
> dan
> 



RE: Frames, concurrency, and EJB Stateful Session beans - a probl em.

2001-04-05 Thread Deadman, Hal

I like this. I have seen the business interface idea described before but I
like the handler as a way to hide EJB calls from the front-end code. Do you
typically access entity beans from stateless session beans or do you call
entity beans directly from the front end? Do you have business interfaces
and handler classes for both entity beans and session beans? 

>From the original post, why not store state somewhere else besides the
stateful session bean? I haven't run into a reason to use stateful session
beans in a web application where there are plenty of other places to store
state (cookies, session, db). I would be interested to hear when people have
found them to be useful. 

Hal

> -Original Message-
> From: Jason Pringle [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 2:41 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Frames, concurrency, and EJB Stateful Session beans - a
> probl em.
> 
> 
> I usually try to stay far away from doing lock/unlock type things with
> threaded access - really testing it can get too hairy, and 
> problems tend to
> be hard to trace.
> 
> The practice we use here for EJBs is thus (it's actually not 
> too hard to do,
> and hides the fact that you're using EJBs from the front end).
> 
> Ixxx.java - interface defining business methods
> xxxBean.java - implementation code: xxxBean implements 
> SessionBean, Ixxx
> xxxHome.java - standard Home interface
> xxxRemote.java - remote interface, extends EJBObject, Ixxx
> xxxHandler.java - wrapper class, implements Ixxx
> 
> The JavaBeans (and JSPs in some cases - no, we're not using 
> Struts (yet))
> use the xxxHandler classes for all access.  The xxxHandler 
> actually does to
> the lookup, home create, portable narrow, and delegates all 
> calls to the
> EJB.  The code is so straightforward it could really be generated (of
> course, we don't do that).  Since everything runs off of the 
> Ixxx interface,
> the compiler will catch if you change signatures in one place 
> and not the
> other.  And your Remote interface is empty, since it just "joins" the
> EJBObject and Ixxx interfaces.
> 
> Food for thought, there are many other ways to do this.
> 
> --jason
> 
> 
> -Original Message-
> From: Bryan Field-Elliot [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 11:33 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: Frames, concurrency, and EJB Stateful Session beans - a
> problem.
> 
> 
> Thanks,
> 
> That proposal would probably work, but it might be a little 
> over-complicated (although I am starting to suspect that 
> every solution 
> is going to be yucky). I think I couldn't do your idea with just a 
> simple bean with a simple syncronized getter method; instead, the 
> wrapper bean would have to have all of the same method 
> signatures as the 
> session bean, and pass through all the calls (doing 
> syncronization first).
> 
> What I'm leaning towards right now, is finding some kind of 
> "per-user" 
> syncronization, which I can "lock" at the start, and "unlock" at the 
> end, of every one of my Action.perform() methods. I can 
> probably do this 
> with a simple class, with two static methods -- "lock" and 
> "unlock" -- 
> and it will take as a parameter the current user's "session" object 
> (Servlet session, that is), so that the locks are per-user, 
> rather than 
> global.
> 
> Comments before I dive in the deep end?
> 
> Thanks,
> 
> Bryan
> 
> Abraham Kang wrote:
> 
> > Hi Bryan,
> > 
> > Can you put the stateful session bean within a JavaBean with
> synchronized
> > methods so that all access to the stateful session bean is 
> through the
> > JavaBean?
> > 
> > --Abraham
> > 
> >> -Original Message-
> >> From: Bryan Field-Elliot [mailto:[EMAIL PROTECTED]]
> >> Sent: Thursday, April 05, 2001 8:09 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: Frames, concurrency, and EJB Stateful Session beans - a
> >> problem.
> >> 
> >> 
> >> I'm having a design problem with my system, which is not 
> really Struts
> >> specific, but since there are a lot of EJB users here, I 
> thought I'd
> >> throw it on this list for comments --
> >> 
> >> My business logic is all implemented in a Stateful EJB 
> Session bean. All
> >> Struts users get one instance of the session bean, whose 
> reference is
> >> stored in the Servlet's Session scope.
> >> 
> >> All of my Struts actions are simple; they take data from the user
> >> (usually in ActionForms), pass them to some method in the 
> EJB Session
> >> bean, and store the results in beans for the JSP page to render.
> >> 
> >> However, my design calls for a few places where there is a 
> frameset, and
> >> in another place, where two browser windows open up showing two
> >> different views. The problem here, is that EJB requires 
> that a Stateful
> >> Session bean have only one thread of execution within it (e.g. no
> >> concurrency). So, when two different Struts actions (or 
> custom tags) try
> >> to invoke a method on the

RE: unsubscribe me

2001-04-05 Thread Deadman, Hal

So how did that work out? Putting "unsubscribe me" it in the subject and the
body was a good try. If it didn't work try the following:

To remove your address from the list, send a message to:
   <[EMAIL PROTECTED]>

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 11:12 AM
> To: [EMAIL PROTECTED]
> Subject: unsubscribe me
> 
> 
> unsubscribe me
> 



RE: Multiple Forms, Single Action

2001-04-04 Thread Deadman, Hal

Both actions can share the same action class but they need to have different
paths, i.e. /saveSurvey can't be the path for both actions. 

> -Original Message-
> From: Anthony Martin [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 04, 2001 1:54 PM
> To: Struts User List (E-mail)
> Subject: Multiple Forms, Single Action
> 
> 
> I have designed a survey for my company using STRUTS.  I have tried to
> follow the MVC paradigm, but I fear I may have missed something.
> 
> I have two forms, Survey1 and Survey2.  They are in the same 
> context called
> survey.  They are represented by their own JSPs called survey1.jsp and
> survey2.jsp.  They both have a form beans called Survey1Form and
> Survey2Form.
> 
> However, instead of two different actions, they both use the 
> same action
> called SaveSurveyAction.  At this time, this action does only 
> two things.
> It checks which instance of form, and arbitrarily returns 
> success.  No real
> inovation here, because I'm just trying to see if it works.
> 
> The problem is, survey1.jsp keeps getting this message when I 
> invoke it in
> the browser:
> 
>   javax.servlet.ServletException: No getter
>   method available for property q2 for bean
>   under name org.apache.struts.taglib.html.BEAN
> 
> The survey2.jsp file does not get this message.  After a bit 
> of debugging,
> it seems that the Survey1Form bean is not being inst'd for 
> survey1.jsp.
> Instead, it looks as if Survey2Form is being inst'd for both 
> survey1.jsp and
> survey2.jsp.
> 
> The property of q2 is not present in Survey2Form, and if I add it, the
> message changes to the next property, q3.  But I don't want 
> Survey2Form to
> have the same properties as Survey1Form.  That's the whole 
> point.  I should
> be able to have two different forms with the same action.  No?
> 
> Here is some of my struts-config.xml:
> 
>   
>type="com.trams.survey.Survey1Form"/>
>type="com.trams.survey.Survey2Form"/>
>   
> 
>   
>   
>   
> 
>   
>  path="/saveSurvey"
>   type="com.trams.survey.SaveSurveyAction"
>   name="survey1Form"
>   scope="request"
>   input="/survey1.jsp"
>   validate="true">
>   
>  path="/saveSurvey"
>   type="com.trams.survey.SaveSurveyAction"
>   name="survey2Form"
>   scope="request"
>   input="/survey2.jsp"
>   validate="true">
>   
>   
> 
> Any pointers would be appreciated.
> 
> 
> Anthony
> 
> It is by caffeine alone I set my mind in motion.
> It is by the Beans of Java that thoughts acquire speed,
> the hands acquire shaking, the shaking becomes a warning.
> It is by caffeine alone I set my mind in motion.
> 



RE: Digester parser error to another output.

2001-04-02 Thread Deadman, Hal

I submitted a bug report about this issue on Friday. You can add your
comments or vote for it. It's bug #1166. 

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1166

Hal

> -Original Message-
> From: Noel Sebastien [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 02, 2001 11:01 AM
> To: '[EMAIL PROTECTED]'
> Subject: Digester parser error to another output.
> 
> 
> Hi,
> 
> I use Digester, and I would like to send output error 
> elsewhere than to
> System.out...
> Second, Digester does not propagate parsing error (in my 
> case, I would like
> to get an Exception when a String is written as an attribute 
> value where I
> am waiting a integer).
> Dealing with the same problems, somebody else wrote the 
> following message. I
> found it in the Archive of the mailing list, but I can't find 
> any related
> solutions, whereas it is a common problem.
> Has anybody got a clue on how to solve these issues?
> 
> Thank you in advance.
> 
> Sébastien
> 
> Archive mail : ---
> 
> Digester seems to be a pretty nice package for translating XML into
> java-objects. I have a question about the error handling though.
> 
> It appears that the Digester doesn't propagate some parsing errors,
> e.g when a required element is missning. It only logs it to stdout.
> 
> I haven't found any way to get notification of those errors.
> I want to make sure that the XML I have parsed, is validate before I
> use the parsed information.
> Also, I don't want all the parsing errors to be written to 
> stdout, because
> I want to take care of the errors and maybe write to other logs
> (and perhaps in other formats) than to stdout.
> Since Digester is declared final one cannot subclass it and override
> the log-methods(or the error-, warning- and fatalError-methods).
> 
> 
> 
> 
> -
> 
> Un courrier électronique n'engage pas son émetteur. Tout 
> message susceptible de comporter un engagement doit être 
> confirmé par un écrit dûment signé.
> 
> An electronic message is not binding on its sender. Any 
> message referring to a binding engagement must be confirmed 
> in writing and duly signed.
> 
> Ein elektronischer Brief bzw. eine elektronische Nachricht 
> ist für den Absender nicht verbindlich. Jede Nachricht,  
> welche eine Verpflichtung beinhaltet, muß schriftlich 
> bestätigt und ordnungsgemäß unterzeichnet werden.
> 
> -
> 
> 



RE: Communicating with EJB's from Action

2001-03-30 Thread Deadman, Hal

I like this description, mainly because it sounds like what I have been
doing. Something like this might make a good section in the documentation -
Struts & EJBs. I would consider the stateless session beans part of the
model because they contain business logic. You also talk about "basic value
checking of attributes". Would you also do this same value checking in the
ActionForm validate method? 

Thanks, Hal

> -Original Message-
> From: Handy, Steve [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 29, 2001 6:04 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Communicating with EJB's from Action
> 
> 
> Chris,
> 
> What we've done is this:
> 
> - Put a layer of business logic session stateless beans above 
> the entity
> EJBs.  The beans in this layer have methods that perform 
> specific business
> functions.
> 
> - Have the Action classes translate the user's click into one 
> or more calls
> to the business logic layer.  We don't pass the ActionForm to 
> the business
> layer, because the ActionForm is too close to the view.  If 
> we need to pass
> a set of related data items to the business layer, we do it 
> with a value
> object that represents the kind of businessy attributes you'd 
> find in an
> EJB.
> 
> So, we partition responsibility like this:
> 
> JSPs: rendering. To us this is View.
> 
> Actions: translation of user actions into business operations 
> (if necessary)
> and always a decision about what to display next.  This layer doesn't
> implement business operations, but knows what high level 
> business operation
> it needs to call to fulfill the user's request.  We consider 
> this layer to
> be Controller.
> 
> Business session stateless beans: fulfillment of business 
> function.  For
> cross-entity operations, do the details here.  Speak in only 
> business terms,
> not in any view terms.  Completely independent of Struts.  
> Still Controller
> for us.
> 
> Entity EJBs: Fulfill single-entity business operations here 
> (like basic
> value checking of attributes).  Of course, these EJBs also 
> give us all the
> entity-bean function we get from the container.  Only this 
> layer knows about
> the database.  In general, we don't let an entity EJB 
> interact with another
> entity EJB; we leave this to the session stateless beans 
> above.  This is our
> Model.
> 
> Utility classes:
>   ActionForms - for passing view-specific information around 
> between Actions
> & JSPs, etc.
>   Value objects - for passing entity-specific information 
> around, including
> up to and down from the Actions.
> 
> Steve
> 
> -Original Message-
> From: Assenza, Chris [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 29, 2001 4:59 PM
> To: '[EMAIL PROTECTED]'
> Subject: Communicating with EJB's from Action
> 
> 
> Hello! :) 
> 
> Our dev team for a big enterprise app has been going back and 
> forth on how
> to send the data from the ActionForm to a Session bean.  We 
> have a number of
> options and I was hoping for some feedback because we've had 
> enough talk and
> its time to decide! :) (Our architecture is as of now to use 
> only Session
> Beans, but we will probably start wrapping Entity beans with 
> Session beans
> eventually).
> 
> 1) Send the ActionForm to the EJB from Action perform()
>   Pros: Easy and less work
>   Cons: Defeats the purpose of Struts in that the 
> Business Logic is no
> longer self-contained and independent of the V in MVC :). If 
> for whatever
> reason we overhaul the front end and remove Struts, we're not 
> in the ideal
> position to do so. 
> 
> 2) Create a special utility class that with special methods, that when
> invoked from the Action perform() method, will put the data 
> from ActionForm
> into a HashTable.  Then, we'll pass that object to the EJB 
> and do whatever
> business logic is necessary.  
> 
> 3) JMS - Sort of an adaptation of the number 2 as JMS uses 
> HashMaps and the
> like but it follows a specific spec and has a lot more to it 
> then what we'd
> be doing above.  However, none of us really know much about 
> JMS yet. :|
> Obviously we can learn, but is it a recommended path to 
> follow from your
> experience? (in regards to Struts specifically as well). 
> 
> 4) RMI or RMI-IIOP.  Create a remote object within the client 
> and pass the
> remote reference to the EJB.  The EJB can then use this 
> reference to make
> callbacks to the client.  Not sure about this one either, seems rather
> inefficient.
> 
> Oh, and one other question, since DataTable (Java collection) 
> is basically
> made up of vectors, can one use the iterate tag to move through it?
> 
> Any thoughts or experiences?? :)
> 
> Thanks,
> 
> Chris Assenza
> 



RE: newbie question

2001-03-14 Thread Deadman, Hal
Title: newbie question




> BNPriceResources is in my 
.../WEB-INF/classes folder and I've got .../WEB-INF/classes in my classpath. 

Don't 
put WEB-INF/classes in your classpath and don't put struts.jar in your 
classpath. Any jarfiles in WEB-INF/lib and the WEB-INF/classes directory get 
added to your webapps classpath. Having them in a the classpath for 
the appserver will cause problems.  

  -Original Message-From: Jesse Vitrone 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, March 14, 2001 
  10:52 AMTo: Struts User Mailing List (E-mail)Subject: 
  newbie question
  I'm new to struts and I'm trying to create a little sample 
  app, but I'm getting this error when I try to go my index.jsp
  javax.servlet.ServletException: Cannot find message resources 
  under key org.apache.struts.action.MESSAGE at 
  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459) 
  at 
  _0002findex_0002ejspindex_jsp_1._jspService(_0002findex_0002ejspindex_jsp_1.java:315) 
  at 
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) 
  at 
  javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
  org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177) 
  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:853) 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:797) 
  at 
  org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) 
  at 
  org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Ajp13ConnectionHandler.java:160) 
  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) 
  What does this mean? 
  I would think that it means that it can't find the properties 
  file, but I've got this in my xml: 
           
      action 
      
      org.apache.struts.action.ActionServlet 
      
       
      
      
      application 
      
      
      BNPriceResources 
      
       
      
       
      
      
      config 
      
      
      /WEB-INF/my-example-config.xml 
      
       
      
       
      
      
      debug 
      
      
      2 
      
       
      
       
      
      
      validate 
      
      
      true 
      
       
      
      1>   
       
  BNPriceResources is in my .../WEB-INF/classes folder and I've 
  got .../WEB-INF/classes in my classpath. 
  Any help would be greatly appreciated. 
  Thanks,     
  Jesse 


RE: More on my copyProperties/EJB woes

2001-03-13 Thread Deadman, Hal



Although copyProperties to an entity 
bean might work, it would be making a call through the remote interface 
each time it sets a property on the entity bean. I think it's good practice 
to minimize the number of remote calls made to an EJB. (Often in practice the 
calls are not really remote but it's good to pretend like they could be.) That 
would allow you to separate your JSPs and EJBs or use Tomcat for JSPs and 
Weblogic for EJBs. Normally instead of calling set methods on an entity bean 
from the web tier, I call a session bean and pass a simple JavaBean to it that 
isn't tied to Struts, often the bean may have been nested in an ActionForm. Then 
I have a create or an update method in the entity bean that accepts 
the JavaBean as an argument. I don't always put all the getters and setters 
for individual fields in the entity bean remote interface unless I need them. 

 
Sorry 
if this isn't helpful, I would be interested to hear if anyone disagrees. 

 
Hal
 
 -Original Message-From: 
Bryan Field-Elliot [mailto:[EMAIL PROTECTED]]Sent: Tuesday, 
March 13, 2001 12:06 AMTo: 
[EMAIL PROTECTED]Subject: More on my copyProperties/EJB 
woes
I've been tearing apart my problems using copyProperties in an EJB 
  environment; The scenario is that I am using 
  PropertyUtils.copyProperties to copy everything FROM a simple bean, TO an EJB 
  entity bean.Earlier tonight I thought that the hangup was over the 
  destination bean, perhaps because it was an EJB remote interface. But my 
  digging turns up that this isn't the case.The exception is during the 
  getting of the source properties (from my simple bean), and it never even gets 
  to the setting of the destination property.I extracted a small piece 
  of code from copyProperties and am executing it directly:// pv is my 
  simple bean, and "name" is a String property within in, which has a getter and 
  a setter method.PropertyDescriptor descriptor;// Following two 
  lines are key:descriptor = PropertyUtils.getPropertyDescriptor(pv, 
  "name");//descriptor = new PropertyDescriptor("name", 
  pv.getClass());Method readMethod = 
  descriptor.getReadMethod();Object value = readMethod.invoke(pv, new 
  Object[0]);When I use the first of the two "descriptor = " lines 
  (thereby making use of Struts), I get the following exception on the invoke() 
  line:Name: 
  java.lang.IllegalArgumentExceptionMessage: object is not an instance of 
  declaring classStack: java.lang.IllegalArgumentException: object is not an 
  instance of declaring classat java.lang.reflect.Method.invoke(Native 
  Method)However, when I use the second of the two "descriptor = 
  " lines (thereby using standard Java SDK reflection), the invoke() line 
  executes correctly.Any help would be appreciated.This is using 
  Struts 1.0 beta-1 
(binaries).Regards,Bryan


RE: diiferent html tags packages?

2001-03-13 Thread Deadman, Hal



Tags 
in taglibs.form.* and taglibs.* should not be used and exist only for backwards 
compatibility with older version of struts. They will be removed at some point. 


  -Original Message-From: Sarbjit Singh 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, March 13, 2001 
  11:21 AMTo: [EMAIL PROTECTED]Subject: 
  diiferent html tags packages?
  hi,
  What is the actual intention or actual 
  diferences between the tags in the:
  org.apache.strtus.taglibs.*
  
  org.apache.strtus.taglibs.html.* and 

  
  org.apache.strtus.taglibs.form.*
  ?
   
   
   
   


RE: Problems with Struts+WebLogic

2001-03-12 Thread Deadman, Hal

2) You probably have struts.jar in your weblogic classpath. It should only
be in the WEB-INF/lib directory of your webapp. 

1) I am using weblogic without having xalan and xerces in the weblogic
classpath. Most of what you would need for a typical application is in
weblogic.jar. 

Hal

-Original Message-
From: Nguyen Thanh Phong [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 11, 2001 11:16 PM
To: [EMAIL PROTECTED]
Subject: Problems with Struts+WebLogic


Hi,

I'm having some problem when using Struts with WebLogic (6.0)

1> I'm using the binary distribution of Struts. Do I still need to download
and configure Xalan XSLT Processor and Xerces? I can run the example
"struts-example" successfully, so I suppose that I don't need these
packages. Am I right?

2> I'm building w sample application using Struts and WebLogic (EJB) but I
have the following error

  
<[WebAppServletContext(756828
7,smart)] Root cause of ServletException
javax.servlet.jsp.JspException: Cannot find message resources under key
org.apac
he.struts.action.MESSAGE
at
org.apache.struts.util.RequestUtils.message(RequestUtils.java:285)
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:2
39)
at jsp_servlet._adminlogin._jspService(_adminlogin.java:111)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:208)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:1127)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>

My JSP file is as following

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>













  

  


  

  

  

  


  

  
  

  


  

  






I'm not quire sure what's going wrong. Please help me.

Thanks in advance.

PS. BTW, is there any searchable archive for Struts-User mailing list?


Nguyen Thanh Phong   Tel: 84-8-837 25 06/837 25 07
Saigon Software Development Company (SDC)Fax: 84-8-837 25 11
10 Co Giang Street, Dist I, HCMC Email:
[EMAIL PROTECTED]
Vietnam



RE: [INFORMATIONAL] Javasoft J2EE Patterns Catalog

2001-03-09 Thread Deadman, Hal



Has 
anyone found a place to download this pattern catalog? It would be nice to have 
a local copy in either PDF or HTML. 
 
This 
link has the on-line version but you need to be logged in to JDC. 

http://developer.java.sun.com/developer/restricted/patterns/J2EEPatternsAtAGlance.html
 
Hal

  -Original Message-From: Philip Hart 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, March 08, 2001 11:41 
  PMTo: [EMAIL PROTECTED]; 
  [EMAIL PROTECTED]Subject: [INFORMATIONAL] Javasoft 
  J2EE Patterns Catalog
  Hi 
  All
   
  Javasoft have just 
  released a J2EE Patterns Catalog (http://www.javasoft.com/features/2001/03/patterns.html) To 
quote:
   
   
  The Sun Java Center 
  has just released, in beta form, the J2EE Patterns Catalog to the development 
  community via the Java Developer 
  ConnectionSM (JDC) program. The 15 
  included J2EE Patterns represent more than three years of work by the Sun Java 
  Center, and contain J2EE platform solutions for common problems experienced by 
  architects using Java technology. The J2EE Patterns Catalog reflects the 
  collective expertise and the experience of architects using Java technology in 
  the Java Center over the past three years.
   
   
  Definitely worth a 
  look, as it has the sort of patterns - Front Controller and Dispatcher for 
  example - which we know and love in Struts.
   
  Happy 
  Reading,
  Philip 
  Hart


RE: Problem with multiple submit image buttons

2001-03-08 Thread Deadman, Hal

Are you doing anything in the reset method of the ActionForm? You may want
to include the jsp code fragment that uses the html:image tags. 

Hal

-Original Message-
From: Wax, Michael [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 12:36 PM
To: '[EMAIL PROTECTED]'
Cc: Boulatian, Misak
Subject: Problem with multiple submit image buttons


I need to determine which of several html:image buttons in a form has been
clicked.  I have tried the following:

public class MyForm extends ActionForm {
...
private MyFormBean bean1 = new MyFormBean();
private MyFormBean bean2 = new MyFormBean();
...
public MyFormBean getBean1 () {return bean1;}
public void setBean1 (MyFormBean bean1) {this.bean1=bean1;}
...
}

The MyFormBean class has accessors for x and y.

Unfortunately, although the request contains bean.x and bean.y values
whenever the button with the property "bean1" has been clicked, getBean1()
returns null.

Am I doing something wrong?  Is there an alternative method of
distinguishing between html:image buttons?



RE: Tomcat 3.2.1

2001-03-07 Thread Deadman, Hal

Make sure struts.jar is not in the tomcat classpath. It should only be in
the WEB-INF/lib directory of your webapps. This is not a bug because struts
and the example app are known to work your platforms. 

Hal
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 07, 2001 2:46 PM
To: [EMAIL PROTECTED]
Subject: Re: Tomcat 3.2.1 




I've found the problem and will post it as a bug.  I just wanted to see if
anyone else has run into this situation.  We've tested it on several
machines
here and have encountered the same error.

First of all the environment.

struts - 1.0-b1 - installed in c:\jakarta-struts-1.0-b1
tomcat - 3.2.1 - installed in c:\jakarta-tomcat-3.2.1
jdk  - 1.3.0_02 - installed in c:\jdk1.3.0_02
MS Windows 2000

Also tested on NT 4.0

The struts-example.war installed in Tomcat's webapp directory run and
behaves as
expected.

If I add c:\jakarta-struts-1.0-b1\lib\struts.jar to my Windows CLASSPATH,
then
run tomcat, I get several errors.

1.  During Tomcat startup, I get:

2001-03-07 01:12:39 - path="/struts-example" :database: init
2001-03-07 01:12:39 - path="/struts-example" :database: Initializing
database
servlet
2001-03-07 01:12:39 - path="/struts-example" :database: Loading database
from
'/WEB-INF/database.xml'
2001-03-07 01:12:39 - path="/struts-example" :database: Database load
exception
- org.xml.sax.SAXException: org.apache.struts.example.User
 at org.apache.struts.digester.Digester.startElement(Digester.java:501)
 at com.sun.xml.parser.Parser.maybeElement(Parser.java:1391)
 at com.sun.xml.parser.Parser.content(Parser.java:1499)
 at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
 at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
 at com.sun.xml.parser.Parser.parse(Parser.java:284)
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:77)
 at org.apache.struts.digester.Digester.parse(Digester.java:716)
 at
org.apache.struts.example.DatabaseServlet.load(DatabaseServlet.java:283)
 at
org.apache.struts.example.DatabaseServlet.init(DatabaseServlet.java:178)
 at javax.servlet.GenericServlet.init(GenericServlet.java:258)
 at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
 at org.apache.tomcat.core.Handler.init(Handler.java:215)
 at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
 at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartup
Interceptor.java:130)
 at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
 at org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
 at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
 at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)

2. When I open a browser (IE 5.5) and goto
http://localhost:8080/struts-example,
I get:

Error 500

javax.servlet.jsp.JspException: Missing message for key index.title
   at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:242)
   at
_0002findex_0002ejspindex_jsp_3._jspService(_0002findex_0002ejspindex_jsp_3.
java:90)

   at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)

   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:853)
   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.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)

   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)


I will post this as a bug,  has anyone else noticed this behavior?

-Donnie Hall
Enron Broadband Services




I'm a new member to your group and am having a strange problem.

I was happily writing struts code when suddenly I was unable to find
applicationresources.properties and struts-config.xml from my app.  I went
back
to the struts-example and it fails too.  The only way I can make it work the
example work again is to add
c:\jakarta-tomcat\webapps\struts-example\WEB-INF\classes to my classpath and
restart To

RE: Database pooling code

2001-03-07 Thread Deadman, Hal

Weblogic's connection pooling lets you specify the SQL statement that you
want to test with. In Oracle you would typically test a connection with
"select dummy from dual". I think you need to allow the test SQL statement
to be configured for each pool. If an exception is raised when it is
executed you can assume the connection is bad. 

Hal

-Original Message-
From: Johan Compagner [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 07, 2001 10:23 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Database pooling code


Do you just test the isClosed() method?
My plan was to execute a small sql code that has a very little overhead
and alway's returns normal for every db if the connection is still good.

But i don't know what kind of sql statement works for every db.

johan


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Matthias Bauer
> Sent: Wednesday, March 07, 2001 4:02 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Database pooling code
>
>
> Database pooling works pretty well for me. But there are some
> pitfalls, when a
> connection times out or the database server is restarted. As the
> framework does
> not check if a connection is still valid before returning it to
> the application
> you will run into an exception when trying to use a connection
> which has timed
> out or was closed due to some other reason on the server side.
>
> I know there was some discussion going on about this on the list
> in the past.
> There were some pros and cons about whether the framework should check the
> validity of a connection before returning it to the application.
> I patched the
> struts code in order to do this check and always return a valid connection
> (requires the jdbc driver Connection.isClosed() method to work
> correctly - some
> have a bug in their implementation). If you are interested in
> this little patch,
> please let me know.
>
> --- Matthias
>
>
> I patched
>
> Jim Richards wrote:
> >
> > Has anyone got the database pooling code/DataSource to work or
> specifically
> > had it fail?
> >
> > I've been having problems (documented previously) and I've read
> about a few others
> > who can't seem to get the pooling to work as well, and I want
> to get an idea
> > of specifically where the problem might lie in order to fix it.
> >
> > 
> > You are the simulacrum of my dreams
> >  and the signifier of my desires
> >
> > Mr Grumpy ... come and visit his home!
> > http://www.cyber4.org/members/grumpy/index.html
>



RE: JSP includes of

2001-03-02 Thread Deadman, Hal

You need to use <%@ include file="/include/header.jsp" %> instead of
jsp:include.

When you use jsp:include it is invoking a seperate jsp. The include file
directive will do an inline of the code from the other file which doesn't
have to be a complete jsp, it may be just a code fragment. For that reason I
would rename header.jsp to header.inc or something. That way if you are
doing a batch jsp compile you will be able to tell jsp fragments from full
jsps using the extension. 

-Original Message-
From: Zia, Asad [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 1:00 PM
To: '[EMAIL PROTECTED]'
Subject: FW: JSP includes of


I am including the taglib URIs in the include file. The page comes up, with
the tags unprocessed. When I view the source of the page, the tags appear
unprocessed as text. 

This is my include file:

//header.jsp
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
Hello!

This is my JSP:
//welcome.jsp



This image does not load in the page but Hello! appears. When I view the
source, this img tag is described explicitly i.e.


Thus my include file is found and loaded without errors, but does not
resolve the taglib URI, without reporting errors. Any suggestion will help!

Thanks

Asad

-Original Message-
From: Katarina Nelson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 5:23 PM
To: [EMAIL PROTECTED]
Subject: RE: JSP includes of


There is exactly what I mean.
Paste the needed taglib tags e.g. :
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
into your "header.jsp" page.

/Katarina

-Original Message-
From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
Sent: den 1 mars 2001 23:12
To: '[EMAIL PROTECTED]'
Subject: RE: JSP includes of


The application finds the header file; I am also sourcing an image which
appears on the page from the include. However, it is unable to resolve the
tag library descriptors. Thus the include statement is fine, it is the
taglib uri that is not working from the include.


Thanks
-Original Message-
From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 4:46 PM
To: [EMAIL PROTECTED]
Subject: Re: JSP includes of


Try to change  to put a full path to
header.jsp file. For example:
. But I am not sure.

Katarina Nelson wrote:

> Try to include the needed .tld files into the "include/header.jsp" page.
> It worked for me.
>
> /Katarina
>
> -Original Message-
> From: Hardee, Tony [mailto:[EMAIL PROTECTED]]
> Sent: den 1 mars 2001 22:29
> To: '[EMAIL PROTECTED]'
> Subject: JSP includes of
>
> I am having trouble using includes and custom tags in JSPs with Struts.
>
> The application is unable to find the tag descriptor files. For example, I
> have an include file that contains:
>
> // header.jsp
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
>
> and call it in the JSP:
> 
>
> The .tld files can not be resolved. The include directory is one level
under
> the JSP and I have tried different paths to the .tld files with no
success.
> How can I get this to work if at all?
>
> Solutions are appreciated.



RE: Drop-down list

2001-03-01 Thread Deadman, Hal

Does this assume that you have loaded a Collection of LabelValueBeans in the
application scope? Do you really need that scriplet at the top of the page?
I thought html:options could reference the collection where it is in the
servlet context, without copying the reference to the page context.

Hal

-Original Message-
From: Spencer Smith [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 11:39 AM
To: [EMAIL PROTECTED]
Subject: Re: Drop-down list


This is how we do it...(I think the work simple should be ommitted)

Get the content at the top of the JSP page.
<%
pageContext.setAttribute("nameSuffixTypes",
getServletContext().getAttribute("nameSuffixTypes"));
%>

Place this where you want the Drop Down List on the JSP page.

   


- Original Message -
From: Kyle   Robinson
To: '[EMAIL PROTECTED]'

Sent: Thursday, March 01, 2001 8:42 AM
Subject: Drop-down list

What is the simplest way to dynamically create a drop-down list
() that pulls values from a database?  Is there a specific tag I
should use?  Iterator?

Kyle Robinson
Systems Consultant
Pangaea Systems Inc.
(250) 360-0111





RE: data-sources for oracle

2001-02-28 Thread Deadman, Hal

If I recall correctly, that error happens when the database isn't being
found. Is the Oracle listener running and properly configured? If it is and
you can connect from other applications then maybe your jdbc url is wrong.

Your url should look like this:
jdbc:oracle:thin:@SERVERNAME:1521:SID

Hal

-Original Message-
From: Tom Maccariella [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 28, 2001 4:18 PM
To: '[EMAIL PROTECTED]'
Subject: data-sources for oracle


Simple question:  I'm trying to test an oracle database connection via the
 configuation settings.  Below is a sample from my
struts-config.xml file:









where SERVERNAME is the hostname of the database server
and SID is the oracle sid 

This produces the following exception:


action: Exception initializing application data source
org.apache.struts.action.DATA_SOURCE java.sql.SQLException: 
The Network Adapter could not establish the connection


Any insight would be greatly appreciated.

-Tom
---
Tom Maccariella
sengen
[EMAIL PROTECTED]
www.sengen.com



RE: Problem since beta1

2001-02-28 Thread Deadman, Hal



A bug 
report has already been filed for this bug. It's bug 697.
 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=697
 
-Original Message-From: Brian 
Bowman [mailto:[EMAIL PROTECTED]]Sent: Wednesday, February 
28, 2001 8:39 AMTo: [EMAIL PROTECTED]Subject: 
Problem since beta1

  
  I have 
  been experiencing a problem since I moved from the Feb 18 nightly build to the 
  beta 1 release. I’ve had to revert back to the nightly build because I do this 
  everywhere in my jsps. Using the following form tag I no longer get the 
  parameter in my Action class when I submit the form. 
  
   
  
   
  So 
  when I do the following in the perform method of AdminUserAction I now get 
  null.
   
  String 
  action = request.getParameter("action");
   
  Is 
  anyone aware of a late change in the beta release that would cause this 
  result?
   
  Any 
  help would be greatly appreciated.
   
  Thanks,
  Brian


RE: How does nested syntax in property attribute work

2001-02-27 Thread Deadman, Hal

In your example you would have a nested JavaBean in your form with a get
accessor that retrieved a nested JavaBean with a definition something like
this:

private AddressBean mailingAddress = new AddressBean();

public AddressBean getMailingAddress();

The AddressBean would need to have getters and setters for a street
property. getStreet() and setStreet(String s).

When you submit the JSP, Struts would call the getMailingAddress() method to
return the nested javabean and then Struts would invoke setAddress and pass
in the data from the input text field. 

You would use this Struts feature if you have JavaBean already and you don't
want to duplicate all of its accessors in the form bean. Or if you want to
be able to pass the data in one JavaBean to a model component but you don't
want to pass Struts objects to your model components. 

Hal

-Original Message-
From: Shamdasani Nimmi-ANS004 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 7:15 PM
To: '[EMAIL PROTECTED]'
Subject: How does nested syntax in property attribute work


Hi,

In some of the e-mails I have seen nested syntax being used for property
attribute, e.g.,



what does that mean? Is it that the getMailingAddress() method of the bean
will be called, and then what is ".street" for?

-Nimmi




RE: Stupd question about Struts and EJB.

2001-02-27 Thread Deadman, Hal

I use EJBs without using copyProperties although it's a matter of
preference. I have a set of JavaBeans that you could call "Data Beans"
because they are often similar to my Entity Beans and they don't contain any
business logic. They are struts free and I pass these data beans to some EJB
components. I often nest the data bean inside the ActionForm class as a
property and use the Struts nested property functionality to populate the
Data JavaBean directly. Sometimes I don't use a nested JavaBean and I just
pass the individual properties of the form to the EJB component. I like
using nested java beans better than calling copyproperties because if I have
a Databean anyway, I don't want to have to redefine lots of getters and
setters in the Struts form bean. 

Hal
-Original Message-
From: Nick Pellow [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 5:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Stupd question about Struts and EJB.



Hello, 

Robert Leland wrote:
> 
> As far as struts 1.0, the Form bean is used only to redisplay
> information to the jsp page. Typically the EJB might be loaded/unloaded in
the
> action class. If you search www.mail-archives.co,m Craig talked more about
this in detail.

My understanding is that with struts you should keep your EJBs entirely
independant of
anything to do with struts or servlets. You can and should however have
a standard naming
convention for the getters and setters across the EJB, the ActionForm
and the html form elements.
this allows you to call PropertyUtils.copyProperties(java.lang.Object
dest, java.lang.Object orig)
when you are ready to store the details entered by the user.

Please let me know if this does not sound right.

Cheers, 
Nick

> In future version of struts this may be enhanced.
> 
> -Rob
> 
> > Cameron Ingram0 wrote:
> >
> > I am in the process of convincing my company to go with MVC and Struts.
As with any thing new,
> > people are sometimes resistant
> > to change. One of the opposition questions I am getting is, how will
this work with EJB(problem is
> > I don't know too much about EJB currently).  Do the EJB's references
just go in the Form and
> > Action Bean and every thing else behaves the same? Are there any obvious
points that I can bring
> > up on the subject?
> > Any help on this subject would be much appreciated!
> >
> > Thanks, Cameron Ingram



RE: Is the struts example itself is multi-thread safe?

2001-02-27 Thread Deadman, Hal

The example is thread safe. Methods don't need to be synchronized if they
aren't manipulating a shared object such as an instance variable. If your
action class doesn't have any instance variables and it only deals with
local variables and parameters then there is a good bet that it is thread
safe. 

Hal

-Original Message-
From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 5:09 PM
To: [EMAIL PROTECTED]
Subject: Is the struts example itself is multi-thread safe? 


Hi,

In "A Walking Tour of the Struts App", the author has mentioned that "There
is only one object for each action (URI), so your action objects must be
multi-thread safe". Is the example itself is multi-thread safe?
I am asking this, because are several actions here, but not one of them use
"synchronized" statement.

Maybe I am missing something...

THANKS in advance.

Maya



RE: struts-example - handle of ServletException

2001-02-27 Thread Deadman, Hal

This is the 3rd or 4th thank you email!!! We have so many emails. The Life
is bad. 

But seriously, I think everyone is thankful for responses they get to their
submissions. If everyone thanked people for every response the list would be
too cluttered. Why not say thanks in advance?

Hal

-Original Message-
From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 3:21 PM
To: [EMAIL PROTECTED]
Subject: Re: struts-example - handle of ServletException


Thank you Incze. This is the 3rd or 4th good suggestions!!! We have so many
gurus.
The Life is good.
Maya

Incze Lajos wrote:

> On Tue, Feb 27, 2001 at 12:07:15PM -0500, Maya Muchnik wrote:
> > Hi,
> > Do you have any ideas how registration.jsp file (struts-example) can be
> > changed to handle a situation when a user call it directly. I do not
"like" a
> > SevletException to be displayed:
> >
> > Error: 500
> > Location: /struts-example/registration.jsp
> > Internal Servlet Error:
> >
> > javax.servlet.ServletException: No bean found under attribute key
> > registrationForm.A LOT OF ERRORS MESSAGES
> >
> > It is better to display some "friendly" error message or return to
login.jsp.
> >
> > Maya
> >
> To avoid situations when a user targets directly to view page I see
> three strategies:
>
> 1. Take all your view pages under WEB-INF.
> 2. Use container managed security and disable access to directories
>where your view pages reside (thes will be available only for
>servlet dispather's forwarding/including).
> 3. Place a logic at the start of your view pages which checks the
>calling URL and redirects/forwards to the appropriate controler
>action.
>
> Each of them has their odds but couldn't find a better solution so far.
>   incze



RE: passing substitution parameters to ActionError still working?

2001-02-22 Thread Deadman, Hal



I 
changed UserForm.MIN_PASSWORD_LENGTH to an Integer from an int but I am still 
getting the same problem. Isn't MK Kan Leung having the same problem as 
me?  Here is his post repeated:

Hi all,
I have a property file like 
this:
common.copyright={0} 
Copyright
I used the following tag to retrieve 
the message:

The displayed message 
becomes:
[Ljava.lang.Object;@47393f 
Copyright
 
Any clue?

  -Original Message-From: Craig R. McClanahan 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, February 21, 
  2001 7:27 PMTo: [EMAIL PROTECTED]Subject: 
  Re: passing substitution parameters to ActionError still 
  working?"Deadman, Hal" wrote: 
   I have a form where I call the following (where 
UserForm.MIN_PASSWORD_LENGTH is an int):errors.add("password", new 
ActionError("error.user.passwordinvalid", 
String.valueOf(UserForm.MIN_PASSWORD_LENGTH)));which references 
this in the ApplicationResource.properties file:error.user.passwordinvalid=The password 
must contain at least {0} characters. But the html:error 
tag displays this: 
The password must contain at least 
[Ljava.lang.Object;@14f467 characters.  I could have sworn 
that this used to work but it doesn't anymore for me. Does passing 
parameters to ActionError objects still work for everyone with recent 
builds? If it still works then I must have broke 
something. Thanks, Hal
  You should be able to pass the length as an object of type Integer, and 
  let the message formatting methods worry about converting it to a String: 
      errors.add("password", new 
  ActionError("error.user.passwordinvalid", 
      new 
  Integer(UserForm.MIN_PASSWORD_LENGTH)); 
  The parameter values are all Objects rather than Strings. 
  Craig   


passing substitution parameters to ActionError still working?

2001-02-22 Thread Deadman, Hal



I have a form where 
I call the following (where UserForm.MIN_PASSWORD_LENGTH is an 
int):
errors.add("password", new 
ActionError("error.user.passwordinvalid", 
String.valueOf(UserForm.MIN_PASSWORD_LENGTH)));
which references 
this in the ApplicationResource.properties file:
error.user.passwordinvalid=The password 
must contain at least {0} characters.
 
But the html:error 
tag displays this:

The password must contain at least 
[Ljava.lang.Object;@14f467 characters. 
 
I could have sworn 
that this used to work but it doesn't anymore for me. Does passing parameters to 
ActionError objects still work for everyone with recent builds? If it still 
works then I must have broke something. 
 
Thanks, 
Hal


RE: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Deadman, Hal

I am not sure what you are looking for. The component library comes with
examples including a struts-template example that uses the component
library. 

The issue with components I was complaining about, albeit not clearly, was
that if a jsp that is part of a component instance and the jsp throws an
exception, the code surrounding the include will trap the exception and
print it to the browser. I would prefer that the exception was not caught so
that I could set up some global handler. Trapping the exception and printing
it to the browser means that the site operator won't know users are
experiencing trouble. 

Below is some of the offending code from
s1.struts.taglib.component.IncludeTag.java. Fixing it would involve trapping
the exceptions and throwing a JspException. Unfortunately that has its own
problems because JspExceptions can't nest the root exception so you don't
know exactly where the error occured. At least you know that something bad
happened. I am not planning to fix this problem for the time being, I am
just planning to write the jsps so they don't fail. :)

Hal

...
pageContext.include(page);
}
   catch (IOException ex)
{
processException( ex, "Can't include page '"+ page+ "' : " +
ex.getMessage() );
}
   catch (IllegalArgumentException ex)
{
// Can't resolve page uri
processException( ex, "Tag 'include' can't include page '" + page +
"'. Check if it exist.\n" + ex.getMessage() );
}
   catch (ServletException ex)
{
Throwable realEx = ex;
if( ex.getRootCause() != null )
  {
  realEx = ex.getRootCause();
  }
processException( realEx, "[ServletException in:"+ page+ "] " +
realEx.getMessage()+ "'" );
}
  catch (Exception ex) {
processException( ex, "[Exception in:" + page + "] "+
ex.getMessage());
}


-Original Message-
From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 11:28 AM
To: [EMAIL PROTECTED]
Subject: Re: Struts, WebLogic 6.0 and template tags


Hal,
Please give a code example with a component, when you cannot get an
exception.
And how it can be fix now.
Maya

"Deadman, Hal" wrote:

> I am using the components add-on and I like it but it shouldn't go into
the
> 1.0 release. It's too much code and has too much functionality to be
merged
> without some more review which will take time. One problem I have noticed
is
> that when a component is included the exceptions are caught which makes it
> difficult to have any kind of global error handler. That's an easy fix but
> merging the code will not be a trivial effort.
>
> Besides, there is no compelling reason to add it to struts now because
there
> is nothing to stop people using struts from also using the components
> framework. When it is added to struts there will probably be some re-work
> involved but it should be straightforward.
>
> Hal
>



RE: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Deadman, Hal

My hasBody() method is like the following so it shouldn't have a null
pointer exception. Are you using a recent nightly build? I think I had this
problem a couple months ago but I think it has been fixed for awhile. 

   private boolean hasBody() {
  if (bodyContent == null)
 return (false);
  return ! bodyContent.getString().equals("");
   }

-Original Message-
From: Beuck, Torsten [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:26 AM
To: '[EMAIL PROTECTED]'
Subject: Struts, WebLogic 6.0 and template tags


Hi, we like to use Struts with Bea WLS 6.0 for a B2B application. Currently
I am developing a prototype and the first tests under Tomcat worked fine. I
used the Struts template tags for a page design with header, navigation menu
and content. An example:

<%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>


  
  
  
  


Now, when I deploy the web application to WLS I get the following:

<21.02.2001 13:21:12 GMT+01:00>  
<[WebAppServletContext(5574888,b2bweb)] Servlet failed with Exception
java.lang.NullPointerException
at org.apache.struts.taglib.template.PutTag.hasBody(PutTag.java:198)
at
org.apache.struts.taglib.template.PutTag.getContent(PutTag.java:181)
at
org.apache.struts.taglib.template.PutTag.doEndTag(PutTag.java:152)
at jsp_servlet._loginpage._jspService(_loginpage.java:111)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1127)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>

I tried to debug the application an it seems as if the setBodyContent()
method of class PutTag is not invoked, so that the bodyContent member
variable is null. This leads to a NullPointerException in the method
hasBody().
Is that right? Is there a workaround? I like the template tags, so i don't
want to give them up.

By the way: Is the problem described in msg01892 (PropertyResource problem
on WebLogic 6.0) fixed?

Thanks, Torsten
---
Torsten Beuck
OTTO Versand
Abteilung IT-SP-WQ
Wandsbeker Str. 3 - 7
22172 Hamburg

Tel.: ++49 40 6461 5351
Fax: ++49 40 6464 5351
eMail: [EMAIL PROTECTED]



RE: Struts, WebLogic 6.0 and template tags

2001-02-21 Thread Deadman, Hal

I am using the components add-on and I like it but it shouldn't go into the
1.0 release. It's too much code and has too much functionality to be merged
without some more review which will take time. One problem I have noticed is
that when a component is included the exceptions are caught which makes it
difficult to have any kind of global error handler. That's an easy fix but
merging the code will not be a trivial effort. 

Besides, there is no compelling reason to add it to struts now because there
is nothing to stop people using struts from also using the components
framework. When it is added to struts there will probably be some re-work
involved but it should be straightforward. 

Hal

-Original Message-
From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:48 AM
To: [EMAIL PROTECTED]
Subject: Re: Struts, WebLogic 6.0 and template tags


Hello, Torsen,

It is not an answer to your question. But I would like to use this email and
ask the struts development team about compatibility template library and
components library (http://www.lifl.fr/~dumoulin/components/). Components
allow
to define "instances" to reuse them with different parameter values. They
have
good examples how to use them for implementation. They do not have a "role"
attribute yet. Both components and templates have a lot of common. Why not
combine the best parts both of them and put under struts project before 1.0
release?

"Beuck, Torsten" wrote:

> Hi, we like to use Struts with Bea WLS 6.0 for a B2B application.
Currently
> I am developing a prototype and the first tests under Tomcat worked fine.
I
> used the Struts template tags for a page design with header, navigation
menu
> and content. An example:
>
> <%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
>
> 
>   
>   
>   
>   
> 
>



RE: help! confused over forms and errors and oooh, other stuff :-)

2001-02-20 Thread Deadman, Hal

I don't know if I understand your question but would making the input
attribute of the action another action give you the opportunity to retrieve
data that the jsp form needs before the jsp is displayed? I have a form that
needs a drop down populated from the database before the form is displayed.
I can never go to the jsp form directly, I always reference the action that
gets the data needed by the jsp. The action returns a forward which forwards
to the jsp with redirect="false". 

Hal

-Original Message-
From: Ned Seagoon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 20, 2001 6:06 PM
To: [EMAIL PROTECTED]
Subject: Re: help! confused over forms and errors and oooh, other stuff
:-)



Can nobody give me a clue as to whether I've missed something here? I have
to do a 'show and tell' session on friday where we probably will be deciding
whether to use struts as the basis of future developments. If I'm going to
have to branch away from struts to handle these issues, so be it, but I'd
rather hope they were handled somewhere. Worst case scenario is that we
don't use struts at all.

Regards
Ned

- Original Message -
From: "Ned Seagoon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 20, 2001 11:47 AM
Subject: help! confused over forms and errors and oooh, other stuff :-)


> Hi Guys,
>
> I wonder if you could help me out a little please? I am in the middle of
> developing a proof of concept app with struts. If this comes off the
company
> could migrate away from a proprietary framework to struts, which I am in
> favour of.
>
> I seem to have confused myself over an issue regarding validation and
forms.
> I’ll give a simplified workflow as an example.
>
> We have for all intents and purposes a generated product overview page
along
> these lines:
>
> *Wooden Throat Mallet59.95 >buy<
> *Leather Uncle Frightener12.60 >buy<
> *Vandal-Proof Toupee 99.99 >buy<
>
> Which is generated from struts tags. The >buys< are links to a pages which
> look something like ‘buyit.do?itemid=50’. The buyit.do action has
registered
> a form in request scope. During processing, it looks up the full details
of
> the itemid and places the resulting bean in request scope. It then creates
> the form object, populates it with some default information and sets this
in
> the request too before forwarding onto buypage.jsp
>
> This displays the details of the item, and contains a form for entering,
> say, credit card details:
>
> *Item: Vandal-Proof Toupee
> *Manufacturer: Lockheed-Martin Advanced Hairpiece Research
> *Price: 99.99
> *Additional Information: Also Invisible to Radar
> *
> * Inside Leg Measurement: _
> * Credit Card Number: 
> * >BUY< {forwards onto checkout.do}
>
> Which is all fine and dandy and displays correctly. Though what happens if
> the form validate fails? If checkout.do has an ‘input’ attribute which is
> buypage.jsp then this will fail because the item details are stored on the
> request has not been set up (it was done in ‘buyit.do’). I could of course
> set the item details on the session, but if the user opened new browser
> windows for the ‘buyit’ link, then the session level object will be
> overwritten.
>
> If have looked into placing the details object onto the form bean as it is
> populated, but will that property be preserved across a validate failing?
> And how do I get at the properties of the form bean outside of the
>  tags?
>
> Help !
>
> Regards
> Ned
>
>
>
> _
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>



RE: Struts on IBM websphere

2001-02-16 Thread Deadman, Hal

Probably not on Websphere 3.0, you need at least 3.5.2.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, February 16, 2001 1:40 PM
To: [EMAIL PROTECTED]
Subject: Struts on IBM websphere





Hi all,

I got to know Struts framework recently. I was greatly influenced by this
design
pattern.
I am planning to implement it in my project. However i have a few queries.

a.  I have to deploy and test my web application on websphere. But websphere
currently
   supports JSP1.0. I am unable to test it in websphere? It does not
recognize
the Tag libaray
  statements that i add to my JSP. Can i test on Websphere by any means.

Cheers
Rafee




**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.Kindlesystems.com
**



RE: netscape 4.7x, session ids and struts

2001-02-15 Thread Deadman, Hal

I think the fix that you describe has already been implemented. Are you
using a recent nightly build?

-Original Message-
From: Gordon Maclean [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 9:09 PM
To: [EMAIL PROTECTED]
Subject: netscape 4.7x, session ids and struts




Using netscape 4.7x on either solaris, linux or windows, the
struts-example fails, because I am bounced between two different
sessions.

The symptom indicates to me that netscape keeps separate lists
of cookies for the following URLs:

http://myhost
http://myhost:80

As one goes through the struts example, the URL is
sometimes displayed as myhost, and sometimes as myhost:80,
and I am never allowed past the login because the user
information is kept in a session associated with myhost,
and can't be found in a session associated with myhost:80.

Environment: struts nightly download as of Feb 12, 2001.
Tomcat 3.2.1, mod_jk, apache 1.3.12 on RH7.

I have all cookies enabled in netscape preferences, with
"Warn before accepting a cookie" also turned on for debugging.

1. When I try the struts-example with the following URL:

http://myhost/struts-example

Netscape asks if I want to send the cookie JSESSIONID=f78s0eymd1,
and I click OK.

2. I select the "Log on ..." link.  Then the logon form is displayed at
a
   URL of
http://myhost:80/struts-example/logon.jsp;jsessionid=f78s0eymd1

Note the cookie in the URL because struts doesn't yet know if my browser 
accepts cookies.  Also note the port number 80 in the URL.

3. I enter user:pass and Submit.  

LogonAction logs the following message:

2001-02-15 01:59:47 - path="/struts-example" :action: LogonAction: 
User 'user' logged on in session f78s0eymd1


The mainMenu.jsp page is displayed, with a URL: 

http://myhost/struts-example/logon.do;jsessionid=f78s0eymd1

(note no port number is in the URL)

4. Then, when I select "Edit your" the netscape question box pops up
asking if I want to send a cookie JSESSIONID=ynsmafyqr1.
The URL is shown as
http://myhost:80/struts-example/editRegistration.do?action=Edit
 
This shouldn't happen, it should use the first session id!

5. When I click on OK, then, EditRegistrationAction logs the following
error:

2001-02-15 02:00:55 - path="/struts-example" :action:  User is not
  logged on in session ynsmafyqr1


The logon.jsp form is again displayed.  If I enter user:pass, then
LogonAction reports a successfull login in session f78s0eymd1
(the first session id again!)

When I select "Edit ..." I get the same error from
EditRegistrationAction about "User is not logged on in session
ynsmafyqr1".
And so on, ad-infinitum.

If I disable cookies in netscape preferences, then things
work with URL rewriting, and EditRegistrationAction forwards me to
registration.jsp.

The problem also does not show up with IE 5.

Also, at step 4, if I manually enter a URL of:
http://myhost/struts-example/editRegistration.do?action=Edit
then EditRegistrationAction succeeds and forwards to registration.jsp. 


If I am right about netscape keeping separate cookie lists, then perhaps
a workaround is for struts (specifically the html taglib) not to add
the port number when generating URLs?

I haven't tested this solution.  

Someone must have run into it also?

Gordon Maclean

-- 
*
Gordon Maclean, Software Engineer, 303 497-8794
Nat'l Center for Atmospheric Research, Boulder CO USA
*



RE: Unable to start Tomcat with Struts

2001-02-14 Thread Deadman, Hal

The following was posted by Craig yesterday and it should answer all of your
classpath questions related to struts.jar. The short version is just put
struts.jar in WEB-INF/lib and do not put WEB-INF/lib in your tomcat
classpath. Do not put it any other location that tomcat can see. 

---from craig

There has been some confusion around the issue of placing "struts.jar"
on your CLASSPATH at execution time, in a servlet container like Tomcat
that makes all such libraries visible to web applications.  This message
is an attempt to clarify the issues, and document why this is
prohibited.

* The "struts.jar" must appear on your classpath at
  compile time for your web application.  The easiest
  way to make this happen is to use an Ant "build.xml"
  file (like Struts itself does) that sets the classpath
  dynamically, or create a custom shell script that sets
  the classpath temporarily for compiling Struts based
  classes.

* The "servlet.jar" file (from your servlet container) must
  be on your classpath at compile time as well, because
  your application's Action classes will refer to interfaces
  that are defined here.

* For reasons discussed further below, "struts.jar" MUST NOT
  be on your system CLASSPATH when you start your servlet
  container (in particular, this applies to Tomcat).

* Placing JAR files in $JAVA_HOME/jre/lib/ext (the system
  extensions directory for Java2) is the same as placing them
  on the classpath.  In other words, you will NOT want to put
  "struts.jar" or "servlet.jar" there.

* For Tomcat, placing JAR files in the "lib" directory (as opposed
  to the WEB-INF/lib directory of your web app) causes them to
  be added to the CLASSPATH automatically.  Therefore, you should
  not put struts.jar here either.

The reason that putting "struts.jar" on your classpath is a bad idea has
to do with the way classloaders work in most servlet containers.  The
details differ between them -- but here is the scoop for Tomcat (3.x and
4.x):

* The library files that are placed on the CLASSPATH when
  Tomcat starts up are made visible through the "system"
  class loader.

* Each individual web application has a custom class loader
  created for it, which makes the classes in WEB-INF/classes
  and WEB-INF/lib visible.  The "parent" class loader of this
  custom class loader is set to the system class loader mentioned
  above.

* When classes are loaded, the JVM starts at the bottom of the
  hierarchy of class loaders, with the webapp class loader, and
  works its way up the hierarchy until it finds that class.  Thus, if
  you have struts.jar in the system classpath, classes from struts.jar
  will be loaded by the system class loader instead of the web app
  class loader.

* When a loaded class references other classes, it looks in its own
  class loader first, and then up the hierarchy.  Under NO circumstances

  will it go down the hierarchy.

* Therefore, if a Struts class is loaded from the system class path,
  that class CANNOT see any of your application classes in
WEB-INF/classes
  or WEB-INF/lib -- you will get ClassNotFoundException instead.

This is the reason that the Struts example application will not run when
you have "struts.jar" on your CLASSPATH.  The digester module of Struts
is loaded from the system class path.  Therefore, it cannot see the
"User" class of the example app, because that class is under
WEB-INF/classes.

If you find that you need to put "struts.jar" on your system classpath
to make Struts work in Tomcat, that means your Tomcat install has been
corrupted.  If you find that your own app will not work UNLESS
struts.jar is in the system classpath, there is something about your
application organization that needs to be analyzed in detail.

Craig

-Original Message-
From: Anderson, Jessica [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 11:57 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Unable to start Tomcat with Struts


David,
I tried having the struts.jar in both places that you mentioned and made
sure the classpath reflected the location. But no change...I am still
getting the same error.  Should I completely remove the jar from one
location if I am pointing to the other location in my classpath?  Would that
create problems?  Still not functional.

Here is another possible clue from a list member:  (does this help?)
"error when the database servlet starts up and tries to
load user objects from the persisted data in the database.xml file.
For some reason, the class loader isn't finding
org.apache.struts.example.User although it is definitly in the right
place."

Any info is appreciated,
Jessica

-Original Message-
From: David Maycock [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 10:39 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Unable to start Tomcat with Struts


Check where the struts.jar file is placed.  I had this problem when the jar
file was placed in the tomcat\lib directory rather than the
tomcat\webapps\xx\web-inf\lib 

RE: Confusion about struts.jar in classpath

2001-02-13 Thread Deadman, Hal

Do you have struts.jar in the WEB-INF/lib directory of the webapp you wrote
yourself?

-Original Message-
From: Shamdasani Nimmi-ANS004 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 4:08 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Confusion about struts.jar in classpath


Yes with struts-example only I don't need to put 'struts.jar' in my
classpath but things are totally different if one has developed/deployed
another application also.

-Original Message-
From: Maya Muchnik [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 3:00 PM
To: [EMAIL PROTECTED]
Subject: Re: Confusion about struts.jar in classpath


Maybe I will give a wrong answer. I think when you have a correct full
application as *.war file you do not need to use CLASSPATH for this
application, but when your
application is not as "good, full, packed" application you need
something,... But what - CLASSPATH or put struts.jar under tomcat/lib ?

I do not build yet my application and do not have your experiment. I have
tested only struts-example.war.

Maya

Shamdasani Nimmi-ANS004 wrote:

> Hi,
>
> I have been following the threads on struts.jar issue and this is what I
have. I have deployed an application using struts 1.0 build with tomcat
3.2.1 on windows NT.
>
> Here's the strange situation:
>
> If I don't add struts.jar in my classpath, I can run struts-example but
CANNOT run my own application. I get the error in the attached
'my_application_error.html' file.
>
>  <>
>
> Now if I add struts.jar in my classpath, I can run my own application but
CANNOT run struts-example now. The error I get is in
'struts_example_error.html' file
>
>  <>
>
> So what is the right way?
>
> -Nimmi
>
>   
>Name: my_application_error.htm
>my_application_error.htmType: Hypertext Markup Language (text/html)
>Encoding: quoted-printable
>
>Name: struts_example_error.htm
>struts_example_error.htmType: Hypertext Markup Language (text/html)
>Encoding: quoted-printable



RE: Using ActionErrors

2001-02-13 Thread Deadman, Hal



I 
haven't tried it but I thought that you could specify the property attribute on 
the errors tag and it would pull out the error that has that property. When you 
add to the ActionErrors object the property is the first argument. You should 
probably use the property name that cooresponds to the property of the form 
field. 
 
 -Original Message-From: 
David J Snowsill [mailto:[EMAIL PROTECTED]]Sent: 
Tuesday, February 13, 2001 4:31 PMTo: 
[EMAIL PROTECTED]Subject: Using 
ActionErrors

  Can anybody point me in the right direction on 
  how to associate a particular error with a particular input field in a 
  form
   
  Thanks
   
  David J SnowsillPrincipal 
  ConsultantCalibre Financial Technology[EMAIL PROTECTED]Office: 
  (61-2) 9212 0527Mobile: 0403 091 468
   
  ***This E-mail is intended 
  only for the use of the individual or entity namedabove and may contain 
  information that is confidential and privileged. If you are not the 
  intended recipient, you are hereby notified that anydissemination, 
  distribution or copying of this E-mail is strictly prohibited. If you 
  have received this E-mail in error, please notify us immediatelyby return 
  e-mail to the sender or by telephoning one of our staff on (61-2)9212 
  0527.  Please then destroy any copies of the original message thatare 
  in your possession. Thank 
  you.***


how to determine size of collections using tags

2001-02-12 Thread Deadman, Hal

Is there a way to determine the size of a collection that one might iterate
over using struts tags rather than a scriptlet? I often want to display one
thing if the collection is empty or I want to iterate over the collection.
The only thing I can think of involves adding a get method to the JavaBean
containing the collection that returns the collection size . That would let
me use the logic:equal tag to check the property. Is there a non-scriptlet
way to do this without adding a method to the JavaBean?


// print message about lack of order line items 



   // start table
   
// show each line item
   







html:img tag url rewriting

2001-02-12 Thread Deadman, Hal



When using the 
html:img tag with the page attribute it will do url rewriting but that doesn't 
seem to work on some webservers. 
 
This doesn't 
work:
http://jakarta.apache.org/images/logos/tomcat_3.gif;jsessionid=123123
 
Is there a way to 
turn off the url rewriting and have the img tag still add the appropriate 
context to the image path?
 
Hal
 


bean-cookie.jsp

2001-02-09 Thread Deadman, Hal




The struts documentation says 
this in 
.../struts-documentation/api/org/apache/struts/taglib/bean/package-summary.html
You must use  
to introduce a reference to an existing bean, if you wish to reference that bean 
with other standard JSP tags (such as  or 
). If you only wish to reference such beans 
with other Struts tags, use of  is not 
required.
The bean-cookie.jsp page in the 
struts-test application uses  but does not first use 
jsp:useBean. This makes Weblogic 6.0 very angry and it fails to generated any 
java code let alone compile the jsp. 
The jsp 1.1 spec implies that the 
jsp:useBean tag does not need to be used before using 
jsp:getProperty.
From page 66 of the 
spec:
An  action 
places the value of a Bean instance property, converted to a String, into the 
implicit out object, from which you can display the value as 
output. The Bean instance must be defined as indicated in the name attribute before this point in the page (usually via a useBean action).
end of 
spec
Either the struts documentation 
should be changed to be less emphatic about the use of 
jsp:useBean or the bean-cookie.jsp should be changed to be nice to 
Weblogic. It could use bean:write only and not use jsp:getProperty. I have 
always assumed the bean:cookie tag didn't work in Weblogic 6.0 because the 
bean:cookie test page didn't work. Maybe there should be a separate test page 
to assess the ability of a jsp engine to use jsp:getProperty for beans 
defined by means other than jsp:useBean. That seems like something the J2EE 
certification suite should test for rather than struts. 
Thanks, 
Hal


BUG: weblogic 6.0 multi-box release bug

2001-02-09 Thread Deadman, Hal



The name property in 
Multibox.java gets defaulted to Constants.BEAN_KEY but the release tag sets it 
to null. This causes it to bomb out in weblogic 6.0 because the name is 
null the second time the tag is used on a page. Actually, I haven't tested 
this yet but it seems to make sense. 
 
 
    protected String name = 
Constants.BEAN_KEY;
 
    /** * Release any 
acquired resources. */    public 
void release() {
 
 super.release(); name = null; property = 
null; value = null;
 
    }


  1   2   >