Re: NestedNotEqualsTag doesn't implement NestedPropertySupport

2002-04-01 Thread Arron Bates

Rob,

It implements NestedNameSupport, which is an extension of 
NestedPropertySupport. So in a way it does implement it. The statement 
is therefore somewhat redundant in the other tags that implement 
NestedNameSupport.
Currently, the tags that you can get the name reference from, you can 
get the property reference from.
I still have to do an audit and clean this all up, but it's certainly 
but pressing at the moment.

Arron.


Rob Leland wrote:

> In doing the UML for the nested Logic tags I noticed
> that the NestedNotLogicEqual doesn't implement
> NestedPropertySupport
>
> public class NestedEqualTag extends EqualTag implements 
> NestedPropertySupport, NestedNameSupport {
>
> public class NestedNotEqualTag extends NotEqualTag implements 
> NestedNameSupport {
>
>
> Is this an oversite, and if not why ?




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: PlugIn (Craig)

2002-04-01 Thread David Winterfeldt

I didn't see this until just now.  I already made it a
comma delimmited list.  Using a Map might be nice, but
I guess a comma delimmited list will be less confusing
to users since the key serves no purpose currently.

David

--- Martin Cooper <[EMAIL PROTECTED]>
wrote:
> I'm speculating wildly here, without looking at the
> code, but... ;-)
> 
> If the  mechanism makes use of the
> full PropertyUtils scheme,
> then you might be able to do something like this:
> 
> 
className="org.apache.struts.validator.ValidatorPlugIn">
>  value="/WEB-INF/validator-rules.xml"/>
>  value="/WEB-INF/validation.xml"/>
> 
> 
> where 'pathname' is a Map property, and 'rules' and
> 'validation' would be
> keys into that Map.
> 
> Then again, even if it works, this is quite likely
> over-engineering for this
> situation...
> 
> --
> Martin Cooper
> 
> 
> - Original Message -
> From: "David Winterfeldt" <[EMAIL PROTECTED]>
> To: "Struts Developers List"
> <[EMAIL PROTECTED]>
> Sent: Saturday, March 30, 2002 6:08 PM
> Subject: Re: PlugIn (Craig)
> 
> 
> > I just wanted to know if this change was on
> purpose.
> > I thought you might have done this on purpose and
> I
> > understand how it breaks the JavaBean model for
> > setters and getters.  I can change it to a comma
> > delimitted list.  I just though having the a
> separate
> > element for each file was cleaner at least on the
> xml
> > side.
> >
> > David
> >
> > --- "Craig R. McClanahan" <[EMAIL PROTECTED]>
> wrote:
> > >
> > >
> > > On Sat, 30 Mar 2002, David Winterfeldt wrote:
> > >
> > > > Date: Sat, 30 Mar 2002 11:44:43 -0800 (PST)
> > > > From: David Winterfeldt
> <[EMAIL PROTECTED]>
> > > > Reply-To: Struts Developers List
> > > <[EMAIL PROTECTED]>
> > > > To: Struts Developers List
> > > <[EMAIL PROTECTED]>
> > > > Subject: PlugIn (Craig)
> > > >
> > > > It looks like when you made changes to the
> PlugIn
> > > > Craig that it broke the ValidatorPlugIn. 
> Having
> > > > multiple set-property elements under the
> plug-in
> > > used
> > > > to work, but now it looks like only the last
> one
> > > is
> > > > being kept.  It looks like the addition of
> > > > PlugInSetPropertyRule in ConfigRuleSet broke
> this.
> > > > You probably know the digester better than I
> do if
> > > > this could be changed.  Or point me in the
> right
> > > > direction if you don't have time to do this.
> > > >
> > > >  > > >
> > >
> >
>
className="org.apache.struts.validator.ValidatorPlugIn">
> > > > > > > value="/WEB-INF/validator-rules.xml"/>
> > > > > > > value="/WEB-INF/validation.xml"/>
> > > > 
> > > >
> > >
> > > The change to the PlugIn configuration did
> indeed
> > > change this, but I'm not
> > > so sure it's a "bad thing" that needs to be
> fixed.
> > >
> > > The basic issue is that PlugInConfig maintains a
> > > simple name-value Map for
> > > the configured properties, which is then
> returned
> > > via getProperties() and
> > > then used as an argument to BeanUtils.populate()
> to
> > > configure the
> > > instantiated PlugIn object.  So, supporting your
> > > syntax above would
> > > require either an API modification, or a change
> to
> > > the contract about what
> > > PlugInConfig.getProperties() returns.
> > >
> > > My discomfort with going ahead and doing this is
> > > based on the fact that it
> > > is somewhat counterintuitive to expect a
> JavaBean
> > > property setter for a
> > > scalar String property to accept and use
> multiple
> > > values when called
> > > mulitple times -- the user of such a bean is
> going
> > > to expect replacement
> > > semantics in this scenario.  It would also not
> be
> > > possible to implement
> > > configuration of this if we extended the DTD to
> > > include a specific PlugIn
> > > (and could therefore use attributes instead of
> > > nested 
> > > elements), because XML doesn't allow multiple
> > > attributes with the same
> > > name.
> > >
> > > Wouldn't it be better to use a comma-delimited
> list
> > > (or something like
> > > that) so you can set this with one setPathname()
> > > method?
> > >
> > > > David
> > > >
> > >
> > > Craig
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > >
> 
> > > For additional commands, e-mail:
> > > 
> > >
> >
> >
> > __
> > Do You Yahoo!?
> > Yahoo! Greetings - send holiday greetings for
> Easter, Passover
> > http://greetings.yahoo.com/
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 

Re: Jakarta Regexp Package Issue

2002-04-01 Thread David Winterfeldt

I'm planning on switching this over tonight.  I'm
ready to check in the changes to Commons Validator. 
The unit test I made shows that changing this fixes
one of the e-mail bugs.  I'll also switch Struts to
use ORO too.

David

--- Martin Cooper <[EMAIL PROTECTED]>
wrote:
> I have no problem with switching to ORO. Then again,
> I must confess to
> having no great knowledge of either package
> (although I do use Regexp on one
> of my projects). It's interesting that Regexp should
> be considered lighter -
> it's a significantly larger download than ORO!
> 
> I don't think we should allow the user to choose. It
> would be confusing to
> the user, and also to us when trying to track down
> problems and subtle
> differences in behaviour.
> 
> --
> Martin Cooper
> 
> 
> - Original Message -
> From: "David Winterfeldt" <[EMAIL PROTECTED]>
> To: "Struts Developers List"
> <[EMAIL PROTECTED]>
> Sent: Friday, March 22, 2002 7:56 AM
> Subject: Jakarta Regexp Package Issue
> 
> 
> > I'm reposting this.  It might be easily missed
> since I
> > forwarded the bug for this that I filed.
> >
> > Email Validation doesn't allow '-' in address. 
> This
> > is an error in the Jakarta Regexp package.  It
> also
> > has trouble with large max values.
> >ex: ^\d{2,1000}$
> >
> > Does anyone think we should just switch to ORO? 
> I'm
> > leaning that way, but I used Jakarta Regexp
> because it
> > was considered 'lighter'.  If it isn't completely
> > reliable, that doesn't really matter.  Or we could
> > include both as an option, but I don't want to
> confuse
> > anyone.
> >
> > David
> >
> >
> >
> > __
> > Do You Yahoo!?
> > Yahoo! Movies - coverage of the 74th Academy
> Awards®
> > http://movies.yahoo.com/
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Jakarta Regexp Package Issue

2002-04-01 Thread Craig R. McClanahan



On Mon, 1 Apr 2002, David Winterfeldt wrote:

> Date: Mon, 1 Apr 2002 08:23:42 -0800 (PST)
> From: David Winterfeldt <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: Struts Developers List <[EMAIL PROTECTED]>
> Subject: Re: Jakarta Regexp Package Issue
>
> I'm planning on switching this over tonight.  I'm
> ready to check in the changes to Commons Validator.
> The unit test I made shows that changing this fixes
> one of the e-mail bugs.  I'll also switch Struts to
> use ORO too.

+1

>
> David
>

Craig


> --- Martin Cooper <[EMAIL PROTECTED]>
> wrote:
> > I have no problem with switching to ORO. Then again,
> > I must confess to
> > having no great knowledge of either package
> > (although I do use Regexp on one
> > of my projects). It's interesting that Regexp should
> > be considered lighter -
> > it's a significantly larger download than ORO!
> >
> > I don't think we should allow the user to choose. It
> > would be confusing to
> > the user, and also to us when trying to track down
> > problems and subtle
> > differences in behaviour.
> >
> > --
> > Martin Cooper
> >
> >
> > - Original Message -
> > From: "David Winterfeldt" <[EMAIL PROTECTED]>
> > To: "Struts Developers List"
> > <[EMAIL PROTECTED]>
> > Sent: Friday, March 22, 2002 7:56 AM
> > Subject: Jakarta Regexp Package Issue
> >
> >
> > > I'm reposting this.  It might be easily missed
> > since I
> > > forwarded the bug for this that I filed.
> > >
> > > Email Validation doesn't allow '-' in address.
> > This
> > > is an error in the Jakarta Regexp package.  It
> > also
> > > has trouble with large max values.
> > >ex: ^\d{2,1000}$
> > >
> > > Does anyone think we should just switch to ORO?
> > I'm
> > > leaning that way, but I used Jakarta Regexp
> > because it
> > > was considered 'lighter'.  If it isn't completely
> > > reliable, that doesn't really matter.  Or we could
> > > include both as an option, but I don't want to
> > confuse
> > > anyone.
> > >
> > > David
> > >
> > >
> > >
> > > __
> > > Do You Yahoo!?
> > > Yahoo! Movies - coverage of the 74th Academy
> > Awards®
> > > http://movies.yahoo.com/
> > >
> > > --
> > > To unsubscribe, e-mail:
> > 
> > > For additional commands, e-mail:
> > 
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
>
>
> __
> Do You Yahoo!?
> Yahoo! Greetings - send holiday greetings for Easter, Passover
> http://greetings.yahoo.com/
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Multi Struts Config files and path context wish

2002-04-01 Thread Craig R. McClanahan



On Sat, 30 Mar 2002, Struts-dev Newsgroup wrote:

> Date: Sat, 30 Mar 2002 21:10:01 -0800
> From: Struts-dev Newsgroup <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Multi Struts Config files and  path context wish
>
> Subject: Multi Struts Config files and path context wish
> From: Vic Cekvenich <[EMAIL PROTECTED]>
>  ===
> Tiles can do multi confi like this, via CSV:
> 
> definitions-config
> 
>/WEB-INF/tiles-defs.xml,/WEB-INF/tiles-tests-defs.xml,/WEB-INF/tiles-tutorial-defs.xml,
>   /WEB-INF/tiles-examples-defs.xml
> 
> Validator does it like this, multi item:
> 
> 
> 
> 
>

This is actually getting changed as we speak -- it depends on *very*
non-inuitive behavior of the setPathname() method.  In a standard
JavaBean, calling setPathname() will always replace the previous value --
this technique would only work if it added each value to a list.  If
that's the behavior you want, the method should be addPathname() or
something instead.

> But to have multi config on Struts-config.xml we will require a path?
> The reason I do not want a path is that on a project, it is sometimes
> hard to spearate who is working on what module like that.
> Also, path in url might not be sectioned like that.
> I like how validator and tiles do it a bit better.
>

For multi-app support, I'm going to start with the assumption that we want
to use a path prefix to distinguish the sub-applications (that's the way
many other frameworks do it, it's consistent with how servlet containers
deal with webapps, ...).  Given that, we have to communicate two pieces of
information to the controller servlet for each subapp:
- The path prefix for that subapp
- The struts-config.xml file to be used.

The current technique embeds the path prefix in the name of the servlet
initialization parameter, and therefore means it is *not* stored inside
the struts-config.xml file for that subapp.  In this way, you can design a
subapp without knowing or caring ahead of time what the path prefix will
be (again, this is consistent with webapp design, where you don't have to
know what the context path will be).

Going to a comma-delimited list of struts-config files gives up this
ability to keep the config files independent of the path - therefore I
don't particularly care for that approach here.

> my 2 c.
> Vic
>

Craig


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Multi Struts Config files and path context wish

2002-04-01 Thread David Winterfeldt


--- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
> 
> 
> On Sat, 30 Mar 2002, Struts-dev Newsgroup wrote:
> 
> > Date: Sat, 30 Mar 2002 21:10:01 -0800
> > From: Struts-dev Newsgroup
> <[EMAIL PROTECTED]>
> > Reply-To: Struts Developers List
> <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: Multi Struts Config files and  path
> context wish
> >
> > Subject: Multi Struts Config files and path
> context wish
> > From: Vic Cekvenich <[EMAIL PROTECTED]>
> >  ===
> > Tiles can do multi confi like this, via CSV:
> > 
> > definitions-config
> >
>
/WEB-INF/tiles-defs.xml,/WEB-INF/tiles-tests-defs.xml,/WEB-INF/tiles-tutorial-defs.xml,
> >  
> /WEB-INF/tiles-examples-defs.xml
> > 
> > Validator does it like this, multi item:
> > 
className="org.apache.struts.validator.ValidatorPlugIn">
> >  value="/WEB-INF/validator-rules.xml"/>
> >  value="/WEB-INF/validation.xml"/>
> > 
> >
> 
> This is actually getting changed as we speak -- it
> depends on *very*
> non-inuitive behavior of the setPathname() method. 
> In a standard
> JavaBean, calling setPathname() will always replace
> the previous value --
> this technique would only work if it added each
> value to a list.  If
> that's the behavior you want, the method should be
> addPathname() or
> something instead.
Fixed as of the nightly build from last night.


   


I wanted an addPathname(), but it cause problems with
BeanUtils.  I assume if I made a PropertyDescriptor it
could deal with it.

David

> 
> > But to have multi config on Struts-config.xml we
> will require a path?
> > The reason I do not want a path is that on a
> project, it is sometimes
> > hard to spearate who is working on what module
> like that.
> > Also, path in url might not be sectioned like
> that.
> > I like how validator and tiles do it a bit better.
> >
> 
> For multi-app support, I'm going to start with the
> assumption that we want
> to use a path prefix to distinguish the
> sub-applications (that's the way
> many other frameworks do it, it's consistent with
> how servlet containers
> deal with webapps, ...).  Given that, we have to
> communicate two pieces of
> information to the controller servlet for each
> subapp:
> - The path prefix for that subapp
> - The struts-config.xml file to be used.
> 
> The current technique embeds the path prefix in the
> name of the servlet
> initialization parameter, and therefore means it is
> *not* stored inside
> the struts-config.xml file for that subapp.  In this
> way, you can design a
> subapp without knowing or caring ahead of time what
> the path prefix will
> be (again, this is consistent with webapp design,
> where you don't have to
> know what the context path will be).
> 
> Going to a comma-delimited list of struts-config
> files gives up this
> ability to keep the config files independent of the
> path - therefore I
> don't particularly care for that approach here.
> 
> > my 2 c.
> > Vic
> >
> 
> Craig
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




DO NOT REPLY [Bug 7663] New: - File Upload example throws exception when run in JBoss 3.0

2002-04-01 Thread bugzilla

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

File Upload example throws exception when run in JBoss 3.0

   Summary: File Upload example throws exception when run in JBoss
3.0
   Product: Struts
   Version: 1.1 Beta 1
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: Normal
  Priority: Other
 Component: File Upload
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Running under JBoss 3.0, Jetty is the servlet container. The upload example
throws a java.lang.IllegalArgumentException: Does not wrap ServletHttpRequest
inside Jetty (I know, I thought it might be a Jetty problem) and causes an HTTP
ERROR: 500 to be thrown when /struts-upload/upload.do is being called.

RequestProcessor.java 972 is the last line in struts that is being executed.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Security Solution

2002-04-01 Thread Phase Web and Multimedia

Greetings,

I wanted to offer some code if anyone is interested. I have seen many
discuss security on archives and wanted to offer an alternative to container
managed security.

I spent some time weighing out whether to use container managed security or
not and came to the conclusion that I would use a filter for security. There
were several inflexibilities in the spec for container managed security. I
wrote a security filter that functions very similar to container managed
security. It has an xml config file that is used to protect urls. There are
a few differences in the config and how you define protected areas and where
you are directed.

Basically there are three areas of greater flexibility.

1) you can define several security-constraint groups with different login
pages.
2) you can login easily without having to hit a secure page first
3) you can set up an app specific security realm. (This can also be
considered a limitation if you are maintaining cross context security, but
you could easily tie into a larger security system if this is needed)

Anyways, it is not the "standard" but it functions well and gives greater
freedom. I found container managed security to be a greater "hack" job when
I wanted to accomplish my goals. If anybody is interested I can post it for
review. It is certainly not mature and the code is fit for my current
situation with an eye to greater flexibility. I think that it could provide
a good starting point for a cross-container simple alternate solution to the
current container managed security.

P.S. I have to improve the documentation :-)

Thanks for your time,
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Redirect problem using Struts in WebSphere 4.0.x

2002-04-01 Thread Sebastian Bub

Hi,

Don has had a problem with redirecting using WebSphere 4.0.2
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg24852.html
where the contextRoot-name was added twice to the url.

We have had the same trouble (WebSphere Advanced Server Edition 4.0.x and
Advanced Single Server Edition 4.0.x). To me, it is a little bit funny
because I thought that they are using a Tomcat base.

Anyway, I tracked this error far down and in my opinion it is a struts bug
because someone depended on the knowledge of implementation of the method
response.encodeRedirectURL within Tomcat.

Within the method processActionForward (in class
org.apache.struts.action.ActionServlet (older struts-version) or from the
nightly build of today in class org.apache.struts.action.RequestProcessor)
there is the following call
response.sendRedirect(response.encodeRedirectURL(path));
which returns different values within different application servers.

If you look into the documentation of Interface
javax.servlet.http.HttpServletResponse.encodeRedirectURL(java.lang.String
url)
the method takes a String parameter named url. Within the method
processActionForward a variable named path is given. So, actually it is a
little bit dirty of the interface to take a String instead of an
java.net.URL.

In my opinion, WebSphere is handling the "path" correctly. Actually, it is
trying to be more helpful (which causes the error) than it needs to be
(adding the contextRoot to the path) where the following lines within
processActionForward do not correspond to WebSphere implementation:
if (forward.getRedirect()) {
  if (path.startsWith("/")) {
if (forward.getContextRelative()) {
  path = request.getContextPath() + path;
...

Therefore I have patched the above line:

response.sendRedirect(response.encodeRedirectURL(toAbsolute(request,
path)));


The implementation of toAbsolute is partly copied from Tomcat sources and
now it is NOT really nice (because of my https-hack), but the functionality
of the URL-constructor is really nice and the java.net.URL class does not
handle https (you can do it better if you want to, but during this state of
url handling no one cares about the actual protocol). One more thing: I did
not give the implementation of replaceStr but I am sure you can imagine
what it is doing:

private String toAbsolute(HttpServletRequest request, String path){
String requrl = javax.servlet.http.HttpUtils.getRequestURL
(request).toString();
String respurl = null;
URL url = null;
boolean needsHttpsToggle = false;

try {
// class URL does not handle https, but functionality of
building absolute
// URL is really nice, therefore we toggle to http
if(requrl != null && "https://".regionMatches(true, 0,
requrl, 0, 8)){
requrl = Utils.replaceStr(requrl, requrl.substring
(0, 8), "http://";);
needsHttpsToggle = true;
}
url = new URL(new URL(requrl), path);
respurl = url.toString();
if(needsHttpsToggle)  // if needed, toggle back to https
respurl = Utils.replaceStr(respurl,
respurl.substring(0, 7), "https://";);
if (debug >= 1)
log("PATCH DEBUG: build absolute URL for
processActionForward");
} catch (java.net.MalformedURLException e2) {
respurl = path;   // Give up
log("PATCH DEBUG: PATCH DID NOT WORK -- build absolute URL
FAILED for processActionForward");
}
return respurl;
}



I have looked into the constructor of java.net.URL and I have played a
little with the constructor
URL url = new URL(new URL(argv[0]), argv[1]);
System.out.println(url.toString());

and in my opinion it always acts correct:
http://www.bla.de /tra/tru.html
--> http://www.bla.de/tra/tru.html

http://www.bla.de/uuu/aa.html /tra/tru.html
--> http://www.bla.de/tra/tru.html

http://www.bla.de/uuu/aa.html tru.html
--> http://www.bla.de/uuu/tru.html

http://www.bla.de/aa.html http://huddel.com/tru.html
--> http://huddel.com/tru.html

I hope it helps, Sebastian





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




FW: Redirect problem using Struts in WebSphere 4.0.x

2002-04-01 Thread Butler, Jeff

We had a similar issue in our application.  It turns out that this is
related to a sendRedirect behavior in Servlet 2.2 that WebSphere chose to
implement differently from everyone else.  The sendRedirect behavior has
been standardized with Servlet 2.3.

In the meantime, you can get an E-FIX for WebSphere that will make it work
the way its supposed to.  The E-FIX is #PQ51545 (a free download from IBM's
site) - it is also included with the 4.0.2 update.

You can enable this behavior by setting the following property in the
WebSphere JVM:

com.ibm.websphere.sendredirect.compliance value=1

Cheers-
Jeff Butler

-Original Message-
From: Sebastian Bub
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: 4/1/02 12:05 PM
Subject: Redirect problem using Struts in WebSphere 4.0.x

Hi,

Don has had a problem with redirecting using WebSphere 4.0.2
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg24852.html
where the contextRoot-name was added twice to the url.

We have had the same trouble (WebSphere Advanced Server Edition 4.0.x
and
Advanced Single Server Edition 4.0.x). To me, it is a little bit funny
because I thought that they are using a Tomcat base.

Anyway, I tracked this error far down and in my opinion it is a struts
bug
because someone depended on the knowledge of implementation of the
method
response.encodeRedirectURL within Tomcat.

Within the method processActionForward (in class
org.apache.struts.action.ActionServlet (older struts-version) or from
the
nightly build of today in class
org.apache.struts.action.RequestProcessor)
there is the following call
response.sendRedirect(response.encodeRedirectURL(path));
which returns different values within different application servers.

If you look into the documentation of Interface
javax.servlet.http.HttpServletResponse.encodeRedirectURL(java.lang.Strin
g
url)
the method takes a String parameter named url. Within the method
processActionForward a variable named path is given. So, actually it is
a
little bit dirty of the interface to take a String instead of an
java.net.URL.

In my opinion, WebSphere is handling the "path" correctly. Actually, it
is
trying to be more helpful (which causes the error) than it needs to be
(adding the contextRoot to the path) where the following lines within
processActionForward do not correspond to WebSphere implementation:
if (forward.getRedirect()) {
  if (path.startsWith("/")) {
if (forward.getContextRelative()) {
  path = request.getContextPath() + path;
...

Therefore I have patched the above line:

response.sendRedirect(response.encodeRedirectURL(toAbsolute(request,
path)));


The implementation of toAbsolute is partly copied from Tomcat sources
and
now it is NOT really nice (because of my https-hack), but the
functionality
of the URL-constructor is really nice and the java.net.URL class does
not
handle https (you can do it better if you want to, but during this state
of
url handling no one cares about the actual protocol). One more thing: I
did
not give the implementation of replaceStr but I am sure you can imagine
what it is doing:

private String toAbsolute(HttpServletRequest request, String path){
String requrl = javax.servlet.http.HttpUtils.getRequestURL
(request).toString();
String respurl = null;
URL url = null;
boolean needsHttpsToggle = false;

try {
// class URL does not handle https, but functionality of
building absolute
// URL is really nice, therefore we toggle to http
if(requrl != null && "https://".regionMatches(true, 0,
requrl, 0, 8)){
requrl = Utils.replaceStr(requrl,
requrl.substring
(0, 8), "http://";);
needsHttpsToggle = true;
}
url = new URL(new URL(requrl), path);
respurl = url.toString();
if(needsHttpsToggle)  // if needed, toggle back to https
respurl = Utils.replaceStr(respurl,
respurl.substring(0, 7), "https://";);
if (debug >= 1)
log("PATCH DEBUG: build absolute URL for
processActionForward");
} catch (java.net.MalformedURLException e2) {
respurl = path;   // Give up
log("PATCH DEBUG: PATCH DID NOT WORK -- build absolute
URL
FAILED for processActionForward");
}
return respurl;
}



I have looked into the constructor of java.net.URL and I have played a
little with the constructor
URL url = new URL(new URL(argv[0]), argv[1]);
System.out.println(url.toString());

and in my opinion it always acts correct:
http://www.bla.de /tra/tru.html
--> http://www.bla.de/tra/tru.html

http://www.bla.de/uuu/aa.html /tra/tru.html
--> http://www.bla.de/tra/tru.html

http://www.bla.de/uuu/aa.html tru.html
--> http://www.bla.de/uuu/tru.html

http://www.bla.de/aa.html http://huddel.com/tru.html
--> http://huddel.com/tru.html

I hope it helps, Sebastian





--
To unsubscrib

DO NOT REPLY [Bug 7665] New: - Form Tag action property

2002-04-01 Thread bugzilla

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

Form Tag action property

   Summary: Form Tag action property
   Product: Struts
   Version: Unknown
  Platform: Other
OS/Version: Other
Status: NEW
  Severity: Enhancement
  Priority: Other
 Component: Custom Tags
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


It appears that the action property is 'guessing' what the correct extension 
should be for an action, even in cases where the extension is explicitly 
specified in the action property.  This is undesirable since, in my case, it is 
guessing incorrectly.  I have two different extensions registered to the action 
servlet, one for authenticated pages and one for non-authenticated pages.

If the action property already has an extension specified, don't change it!

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problems with 1.1b1

2002-04-01 Thread Ronel Sumibcay

I take back where the fix should take place. Its really a J2EE issue so the
fix should really take place in the servlet container before it calls the
init() method of a preloaded servlet. 

Folks with commit priveledges...what do you guys think? Will it hurt to have
this change in the ActionServet's init() method? Should struts attempt to
cater to partially compliant J2EE servlet containers? Or should I take this
problem to the tomcat and jrun lists?

The answer to these questions will help me decide if i should make a
struts-myfix.jar or wait for a stable strtus 1.1 with the fix, or wait for
jrun with a bug fix.

Thanks.

-ronel



-Original Message-
From: Ronel Sumibcay [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 29, 2002 3:59 PM
To: 'Struts Developers List'
Subject: RE: Problems with 1.1b1



The problem may be that the servlet engine may not be calling 

Thread.setContextClassLoader(ClassLoader) when initializing a servlet from
preload.

This seems to be the case for JRun3.1. It may be the same for Tomcat 3.3a.
I've made the fix to my ActionServlet, but I think it really needs to be
done in LogFactory.findClassLoader(). The fix for ActionServlet involves
moving the LogFactory.getLog() into the init() method of ActionServlet

public void init() 
{

Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader(
));
  log = LogFactory.getLog(this.getClass());

initInternal();
initOther();
initServlet();

...
}

The LogFactory.findClassLoader() checks for null to the call to 
Thread.currentThread().getContextClassLoader(), but according to the docs it
either the primordial classloader or the classloader set when the thread was
created. It seems like it was never set, so the primordial classloader is
being returned, thus the ClassNotFoundExceptions.

Hope this helps

-ronel


-Original Message-
From: Martin Cooper [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 10:15 PM
To: Struts Developers List
Subject: Re: Problems with 1.1b1


Unfortunately, you're not the only one seeing these problems. I really
thought I'd tested the struts-example app with four different containers
(Tomcat 3.3a, Tomcat 4.0.3, Resin 1.2.10, Resin 2.0.5) before I released the
beta, but it seems I must not have tested under Tomcat 3.3a. ;-( The other
three work just fine.

Here's what I know so far:

1) The problem is related to class loaders, and possibly to the
LogFactory.findClassLoader() method. The fact that LogFactory.getLog() is
called at (ActionServlet) class initialisation time may also be significant.

2) It is related to the  element. If the web app is not
loaded on startup, this error does not occur. (Others do, of course, but we
get past this problem.)

3) The problem can be worked around by copying commons-logging.jar to:

%TOMCAT_HOME%\lib\common

Unfortunately, I'm by no means a class loader expert, so I'm not sure where
to go from here. Hopefully someone who has more class loader knowledge than
I do can chip in now...

--
Martin Cooper


- Original Message -
From: "Cedric Dumoulin" <[EMAIL PROTECTED]>
To: "Struts Developers List" <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 9:50 AM
Subject: Re: Problems with 1.1b1


>
>   After playing with different configurations, here are my conclusions :
>
>* 1.1b1 struts-example work fine with tomcat4.0.3 and jdk1.4
>* 1.1b1 struts-example doesn't work with tomcat3.3a and jdk1.4 (can't
find
>  LogFactory.java)
>* 1.1b1 struts-example doesn't work with tomcat3.3a and jdk1.3 (can't
find
>  LogFactory.java)
>
>   Am I the only one having these problems ? Does someone else have tried
and got 1.1b1
> running with tomcat3.3.
>   Of course, the commons logging package is in WEB-INF/lib/..
>
>  Cedric
>
> Cedric Dumoulin wrote:
>
> >   I have downloaded and try the 1.1b1 binaries, and can't get it running
> > !
> >   I use tomcat 3.2.3 and jdk1.3.
> >
> >   Does someone have successfully tested the binaries distribution ?
> >
> >   When trying the struts-examples, I've got :
> >
> > java.lang.ExceptionInInitializerError:
> > org.apache.commons.logging.LogConfigurationException:
> > java.lang.ClassNotFoundException:
> > org.apache.commons.logging.impl.LogFactoryImpl
> > at
> > org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:497)
> > at
> > org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:350)
> > at
> > org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381)
> > at
> >
org.apache.struts.util.MessageResourcesFactory.(MessageResourcesFactory.java
:135)
> >
> > at
> >
org.apache.struts.util.MessageResources.getMessageResources(MessageResources
.java:557)
> >
> > at org.apache.struts.taglib.html.HtmlTag.(HtmlTag.java:94)
> >
> >   Cedric
> >
> > --
> > To unsubscribe, e-mail:

> > For additional commands, e-mail:

>
>
> --
> To un

SubApps with 1.1

2002-04-01 Thread Ditlinger, Steve

I notice that none of the 1.1 Beta1 examples include sub-application
configurations. Is this feature ready for prime time? 

If so, are there any good examples anywhere? 

My attempts to use new feature this have not met with success. 

Thanks, 
Steve 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




DO NOT REPLY [Bug 7671] New: - iPlanet Web Server documentation not up-to-date

2002-04-01 Thread bugzilla

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

iPlanet Web Server documentation not up-to-date

   Summary: iPlanet Web Server documentation not up-to-date
   Product: Struts
   Version: Unknown
  Platform: Sun
   URL: http://jakarta.apache.org/struts/doc-1.0.2/installation-
ip.html
OS/Version: Solaris
Status: NEW
  Severity: Normal
  Priority: Other
 Component: Documentation
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Yout iPlanet Web Server documentation for Struts is not up-to-date and 
therefore, I am not sure how I install this on iPlanet Web Server v6.0. You 
have iPlanet Application Server v6, but only iPlanet Web Server v4.1. My 
understanding is that the new version of the web server makes it much 
easier to install Struts, but I have no idea how to do this.

Updated documentation for iPlanet Web Server v6 would be great!

Than kyou.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Security Solution

2002-04-01 Thread Dr. BaTien Duong

Please post and/or send 1 copy to me. Thanks.

- Original Message -
From: "Phase Web and Multimedia" <[EMAIL PROTECTED]>
To: "Struts User" <[EMAIL PROTECTED]>; "Struts Developers List"
<[EMAIL PROTECTED]>
Sent: Monday, April 01, 2002 11:49 AM
Subject: Security Solution


> Greetings,
>
> I wanted to offer some code if anyone is interested. I have seen many
> discuss security on archives and wanted to offer an alternative to
container
> managed security.
>
> I spent some time weighing out whether to use container managed security
or
> not and came to the conclusion that I would use a filter for security.
There
> were several inflexibilities in the spec for container managed security. I
> wrote a security filter that functions very similar to container managed
> security. It has an xml config file that is used to protect urls. There
are
> a few differences in the config and how you define protected areas and
where
> you are directed.
>
> Basically there are three areas of greater flexibility.
>
> 1) you can define several security-constraint groups with different login
> pages.
> 2) you can login easily without having to hit a secure page first
> 3) you can set up an app specific security realm. (This can also be
> considered a limitation if you are maintaining cross context security, but
> you could easily tie into a larger security system if this is needed)
>
> Anyways, it is not the "standard" but it functions well and gives greater
> freedom. I found container managed security to be a greater "hack" job
when
> I wanted to accomplish my goals. If anybody is interested I can post it
for
> review. It is certainly not mature and the code is fit for my current
> situation with an eye to greater flexibility. I think that it could
provide
> a good starting point for a cross-container simple alternate solution to
the
> current container managed security.
>
> P.S. I have to improve the documentation :-)
>
> Thanks for your time,
> Brandon Goodin
> Phase Web and Multimedia
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problems with 1.1b1

2002-04-01 Thread Craig R. McClanahan



On Mon, 1 Apr 2002, Ronel Sumibcay wrote:

> Date: Mon, 1 Apr 2002 11:37:04 -0800
> From: Ronel Sumibcay <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: 'Struts Developers List' <[EMAIL PROTECTED]>
> Subject: RE: Problems with 1.1b1
>
> I take back where the fix should take place. Its really a J2EE issue so the
> fix should really take place in the servlet container before it calls the
> init() method of a preloaded servlet.
>
> Folks with commit priveledges...what do you guys think? Will it hurt to have
> this change in the ActionServet's init() method? Should struts attempt to
> cater to partially compliant J2EE servlet containers? Or should I take this
> problem to the tomcat and jrun lists?
>
> The answer to these questions will help me decide if i should make a
> struts-myfix.jar or wait for a stable strtus 1.1 with the fix, or wait for
> jrun with a bug fix.
>
> Thanks.
>

There are a couple of dimensions to this issue:

* J2EE 1.3 (and therefore Servlet 2.3) require that the thread context
  class loader be initialized appropriately for all web applications.
  For example, Tomcat 4 does this.

* Such support was *not* required in J2EE 1.3 (and therefore Servlet 2.2)
  environments, but it is widely supported.

* Tomcat 3.x purports to support this feature, but IIRC you have to
  explicitly configure it in server.xml by including a particular
  interceptor or something.  Have you got this set up correctly?

* If you have indeed configured this as required, I would suggest it is
  probably a Tomcat 3.3 bug -- it should set up the same context class
  loader for actually loading the servlet class (which fires off the
  getLog() initializers) as it does when calling the service() method.

* The issue is not Struts-specific ... it would affect *any* web app
  that uses the recommended logger discovery mechanism, fired when the
  servlet is initially loaded.

Given that, has anyone reported this as a Tomcat 3.3 bug?

> -ronel
>

Craig


>
>
> -Original Message-
> From: Ronel Sumibcay [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 29, 2002 3:59 PM
> To: 'Struts Developers List'
> Subject: RE: Problems with 1.1b1
>
>
>
> The problem may be that the servlet engine may not be calling
>
> Thread.setContextClassLoader(ClassLoader) when initializing a servlet from
> preload.
>
> This seems to be the case for JRun3.1. It may be the same for Tomcat 3.3a.
> I've made the fix to my ActionServlet, but I think it really needs to be
> done in LogFactory.findClassLoader(). The fix for ActionServlet involves
> moving the LogFactory.getLog() into the init() method of ActionServlet
>
> public void init()
> {
>
> Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader(
> ));
>   log = LogFactory.getLog(this.getClass());
>
> initInternal();
> initOther();
> initServlet();
>
>   ...
> }
>
> The LogFactory.findClassLoader() checks for null to the call to
> Thread.currentThread().getContextClassLoader(), but according to the docs it
> either the primordial classloader or the classloader set when the thread was
> created. It seems like it was never set, so the primordial classloader is
> being returned, thus the ClassNotFoundExceptions.
>
> Hope this helps
>
> -ronel
>
>
> -Original Message-
> From: Martin Cooper [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 10:15 PM
> To: Struts Developers List
> Subject: Re: Problems with 1.1b1
>
>
> Unfortunately, you're not the only one seeing these problems. I really
> thought I'd tested the struts-example app with four different containers
> (Tomcat 3.3a, Tomcat 4.0.3, Resin 1.2.10, Resin 2.0.5) before I released the
> beta, but it seems I must not have tested under Tomcat 3.3a. ;-( The other
> three work just fine.
>
> Here's what I know so far:
>
> 1) The problem is related to class loaders, and possibly to the
> LogFactory.findClassLoader() method. The fact that LogFactory.getLog() is
> called at (ActionServlet) class initialisation time may also be significant.
>
> 2) It is related to the  element. If the web app is not
> loaded on startup, this error does not occur. (Others do, of course, but we
> get past this problem.)
>
> 3) The problem can be worked around by copying commons-logging.jar to:
>
> %TOMCAT_HOME%\lib\common
>
> Unfortunately, I'm by no means a class loader expert, so I'm not sure where
> to go from here. Hopefully someone who has more class loader knowledge than
> I do can chip in now...
>
> --
> Martin Cooper
>
>
> - Original Message -
> From: "Cedric Dumoulin" <[EMAIL PROTECTED]>
> To: "Struts Developers List" <[EMAIL PROTECTED]>
> Sent: Friday, March 22, 2002 9:50 AM
> Subject: Re: Problems with 1.1b1
>
>
> >
> >   After playing with different configurations, here are my conclusions :
> >
> >* 1.1b1 struts-example work fine with tomcat4.0.3 and jdk1.4
> >* 1.1b1 struts-example doesn't work with tomcat3.3a and jdk1.4 (can't
> find

RE: Problems with 1.1b1

2002-04-01 Thread Craig R. McClanahan



On Mon, 1 Apr 2002, Craig R. McClanahan wrote:

>
> * Such support was *not* required in J2EE 1.3 (and therefore Servlet 2.2)
>   environments, but it is widely supported.
>

Err, that should have said J2EE 1.2 rather than 1.3.

Craig



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




ActionForward integration question

2002-04-01 Thread Heath Chiavettone

It seems that I may have biased this question with the title I used on the
struts-users list since I didn't get any answers.  So perhaps you dev guys
might be able to help me:  Here is my question:

 

We have a resource management scheme that will take a relative pathed
resource, and for a particular user (based on some session variables) will
resolve this relative pathed resource into an absolute resource (i.e. if the
user belongs to "ACME" company, we will resolve the resource

jsp/SomePage.jsp into /brands/acme/jsp/SomePage.jsp).  I want to be able to
define my  definitions as relative paths, and somehow insert our
resource manager in between the returning of the (relative) ActionForward
from the Action.execute() call and the actual RequestDispatcher "forwarding"
mechanism.  The only method parameter I would need to be able to resolve the
resource is the HttpServletRequest.

 

Is this scheme even possible in Struts 1.1?

 

If not, is there an alternate to this that doesn't involve me having
forwards for every possible configuration?

 

Thanks,

 

Heath




RE: ActionForward integration question

2002-04-01 Thread Tim Moore

If I understand your problem correctly, it would seem like the easiest
thing to do is create a base Action class that all of your actions
extend which captures the return values and does whatever it needs:

public class MyAction extends Action {
  public ActionForward execute( ... ) throws Exception {
ActionForward forward = myExecute( ... );
return mungeForward( forward );
  }

  public abstract ActionForward myExecute( ... ) throws Exception;

  private ActionForward mungeForward( ActionForward forward )
  {

  }
}

That's the basic idea...
-- 
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


> -Original Message-
> From: Heath Chiavettone [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, April 01, 2002 4:55 PM
> To: '[EMAIL PROTECTED]'
> Subject: ActionForward integration question
> 
> 
> It seems that I may have biased this question with the title 
> I used on the struts-users list since I didn't get any 
> answers.  So perhaps you dev guys might be able to help me:  
> Here is my question:
> 
>  
> 
> We have a resource management scheme that will take a 
> relative pathed resource, and for a particular user (based on 
> some session variables) will resolve this relative pathed 
> resource into an absolute resource (i.e. if the user belongs 
> to "ACME" company, we will resolve the resource
> 
> jsp/SomePage.jsp into /brands/acme/jsp/SomePage.jsp).  I want 
> to be able to define my  definitions as relative 
> paths, and somehow insert our resource manager in between the 
> returning of the (relative) ActionForward from the 
> Action.execute() call and the actual RequestDispatcher 
> "forwarding" mechanism.  The only method parameter I would 
> need to be able to resolve the resource is the HttpServletRequest.
> 
>  
> 
> Is this scheme even possible in Struts 1.1?
> 
>  
> 
> If not, is there an alternate to this that doesn't involve me 
> having forwards for every possible configuration?
> 
>  
> 
> Thanks,
> 
>  
> 
> Heath
> 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Security Solution

2002-04-01 Thread Neil Pitman

Hello Brandon,

This might be interesting to me, but then I'm a newbie so I'm not sure 
whether I should be interested.

As an alternative to posting sources here, you could create a project on 
SourceForge.net.  It would relieve this list of the specific traffic.

One aspect of documentation that I find particularly lacking is an 
"appropriateness" section.  I expect it to be missing in commercial 
documentation (because no one wants to lose a sale).  I have been 
searching open source for the last few months.  I really have to dig 
into each project to understand whether it is appropriate.

Could you provide:
1) indications for use
2) contra-indications against use
3) known complementary technologies (those it depends upon, those that 
depend on it, those with a synergistic relationship)
4) known competative technologies (ones where I have to choose the one 
feature set or another)
5) a comparative feature list (including versions of competitors).

Ok, it sounds like I want a month of the marketing department.  A line 
or two would suffice.  Indeed, "unknown" would help - it would at least 
tell me that I'm on my own.


Phase Web and Multimedia wrote:

> Greetings,
> 
> I wanted to offer some code if anyone is interested. I have seen many
> discuss security on archives and wanted to offer an alternative to container
> managed security.
> 
> I spent some time weighing out whether to use container managed security or
> not and came to the conclusion that I would use a filter for security. There
> were several inflexibilities in the spec for container managed security. I
> wrote a security filter that functions very similar to container managed
> security. It has an xml config file that is used to protect urls. There are
> a few differences in the config and how you define protected areas and where
> you are directed.
> 
> Basically there are three areas of greater flexibility.
> 
> 1) you can define several security-constraint groups with different login
> pages.
> 2) you can login easily without having to hit a secure page first
> 3) you can set up an app specific security realm. (This can also be
> considered a limitation if you are maintaining cross context security, but
> you could easily tie into a larger security system if this is needed)
> 
> Anyways, it is not the "standard" but it functions well and gives greater
> freedom. I found container managed security to be a greater "hack" job when
> I wanted to accomplish my goals. If anybody is interested I can post it for
> review. It is certainly not mature and the code is fit for my current
> situation with an eye to greater flexibility. I think that it could provide
> a good starting point for a cross-container simple alternate solution to the
> current container managed security.
> 
> P.S. I have to improve the documentation :-)
> 
> Thanks for your time,
> Brandon Goodin
> Phase Web and Multimedia
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 


-- 
Neil Pitman
[EMAIL PROTECTED]
+1.514.863.5465


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-struts build-webapp.xml build.properties.sample build.xml

2002-04-01 Thread dwinterfeldt

dwinterfeldt02/04/01 19:59:54

  Modified:.build-webapp.xml build.properties.sample build.xml
  Log:
  Switching from Jakarta Regexp to Jakarta ORO regular expression package.
  
  Revision  ChangesPath
  1.9   +1 -0  jakarta-struts/build-webapp.xml
  
  Index: build-webapp.xml
  ===
  RCS file: /home/cvs/jakarta-struts/build-webapp.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- build-webapp.xml  22 Jan 2002 01:18:07 -  1.8
  +++ build-webapp.xml  2 Apr 2002 03:59:54 -   1.9
  @@ -269,6 +269,7 @@
 
 
   
  +
   
 
   
  
  
  
  1.10  +4 -4  jakarta-struts/build.properties.sample
  
  Index: build.properties.sample
  ===
  RCS file: /home/cvs/jakarta-struts/build.properties.sample,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- build.properties.sample   18 Mar 2002 01:44:51 -  1.9
  +++ build.properties.sample   2 Apr 2002 03:59:54 -   1.10
  @@ -6,7 +6,7 @@
   # to "build.properties" in the same directory that contains the Struts
   # "build.xml" file.
   #
  -# $Id: build.properties.sample,v 1.9 2002/03/18 01:44:51 dwinterfeldt Exp $
  +# $Id: build.properties.sample,v 1.10 2002/04/02 03:59:54 dwinterfeldt Exp $
   # -
   
   # WARNING:  The relative paths below assume that the build.xml file is in the
  @@ -52,9 +52,9 @@
   # from the Jakarta Commons project.
   commons-validator.jar=/usr/local/commons-validator/commons-validator.jar
   
  -# The JAR file containing version 1.2 (or later) of the 
  -# Jakarta Regexp package.
  -regexp.jar=/usr/local/jakarta-regexp/jakarta-regexp-1.2.jar
  +# The JAR file containing version 2.06 (or later) of 
  +# the the Jakarta ORO project.
  +jakarta-oro.jar=/usr/local/jakarta-oro/jakarta-oro.jar
   
   # The JAR file containing the JDBC 2.0 Optional Package extensions API
   # (javax.sql).  This file will automatically be added to your class path
  
  
  
  1.67  +8 -1  jakarta-struts/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-struts/build.xml,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- build.xml 18 Mar 2002 01:45:58 -  1.66
  +++ build.xml 2 Apr 2002 03:59:54 -   1.67
  @@ -56,6 +56,10 @@
 of the Jakarta Commons VALIDATOR
 package (version 1.0 or later).
   
  +jakarta-oro.jar(required).  The path to the JAR file
  +  of the Jakarta ORO
  +  package (version 2.06 or later).
  +
   jdbc20ext.jar (required).  The path to the JAR file
 for the JDBC 2.0 Optional Package APIs.
   
  @@ -191,7 +195,7 @@
 
 
 
  -  
  +  
 
 
 
  @@ -214,6 +218,7 @@
   
   
   
  +
   
   
   
  @@ -275,6 +280,8 @@
   tofile="${build.home}/library/commons-services.jar"/>
   
  +
   
   
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-struts/src/share/org/apache/struts/validator DynaValidatorActionForm.java DynaValidatorForm.java ValidatorActionForm.java ValidatorForm.java

2002-04-01 Thread dwinterfeldt

dwinterfeldt02/04/01 20:02:13

  Modified:src/share/org/apache/struts/validator
DynaValidatorActionForm.java DynaValidatorForm.java
ValidatorActionForm.java ValidatorForm.java
  Log:
  Adding access to ValidatorResults and the Map of any values returned from the 
validation methods processed by the Commons Validator.
  
  Revision  ChangesPath
  1.3   +9 -2  
jakarta-struts/src/share/org/apache/struts/validator/DynaValidatorActionForm.java
  
  Index: DynaValidatorActionForm.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/validator/DynaValidatorActionForm.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DynaValidatorActionForm.java  18 Mar 2002 05:14:27 -  1.2
  +++ DynaValidatorActionForm.java  2 Apr 2002 04:02:13 -   1.3
  @@ -1,4 +1,10 @@
   /*
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/validator/DynaValidatorActionForm.java,v
 1.3 2002/04/02 04:02:13 dwinterfeldt Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/02 04:02:13 $
  + *
  + * 
  + *
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation.  All rights
  @@ -81,8 +87,9 @@
* See ValidatorPlugin definition in struts-config.xml
* for validation rules.
*
  - * @since 1.1
* @author David Winterfeldt
  + * @version $Revision: 1.3 $ $Date: 2002/04/02 04:02:13 $
  + * @since 1.1
   */
   
   public class DynaValidatorActionForm extends DynaValidatorForm implements DynaBean, 
Serializable {
  @@ -114,7 +121,7 @@
errors, page);
   
try {
  -validator.validate();
  +validatorResults = validator.validate();
   } catch (ValidatorException e) {
   log.error(e.getMessage(), e);
}
  
  
  
  1.2   +44 -2 
jakarta-struts/src/share/org/apache/struts/validator/DynaValidatorForm.java
  
  Index: DynaValidatorForm.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/validator/DynaValidatorForm.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DynaValidatorForm.java18 Mar 2002 01:42:51 -  1.1
  +++ DynaValidatorForm.java2 Apr 2002 04:02:13 -   1.2
  @@ -1,4 +1,10 @@
   /*
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/validator/DynaValidatorForm.java,v
 1.2 2002/04/02 04:02:13 dwinterfeldt Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/02 04:02:13 $
  + *
  + * 
  + *
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation.  All rights
  @@ -57,6 +63,7 @@
   
   import java.io.Serializable;
   import java.util.Locale;
  +import java.util.Map;
   import javax.servlet.ServletContext;
   import javax.servlet.http.HttpServletRequest;
   import org.apache.commons.beanutils.DynaBean;
  @@ -65,6 +72,7 @@
   import org.apache.commons.validator.Validator;
   import org.apache.commons.validator.ValidatorException;
   import org.apache.commons.validator.ValidatorResources;
  +import org.apache.commons.validator.ValidatorResults;
   import org.apache.struts.action.ActionErrors;
   import org.apache.struts.action.DynaActionForm;
   import org.apache.struts.action.ActionMapping;
  @@ -81,8 +89,9 @@
* See ValidatorPlugin definition in struts-config.xml 
* for validation rules.
*
  - * @since 1.1
* @author David Winterfeldt
  + * @version $Revision: 1.2 $ $Date: 2002/04/02 04:02:13 $
  + * @since 1.1
* @see org.apache.struts.action.ActionForm
   */
   
  @@ -94,6 +103,12 @@
   private Log log = LogSource.getInstance(this.getClass().getName());
   
   /**
  + * The results returned from the validation performed 
  + * by the Validator.
  +*/
  +protected ValidatorResults validatorResults = null;
  +
  +/**
* Used to indicate the current page of a multi-page form.
   */
   protected int page = 0;
  @@ -134,7 +149,7 @@
errors, page);

try {
  -validator.validate();
  +validatorResults = validator.validate();
   } catch (ValidatorException e) {
   log.error(e.getMessage(), e);
}
  @@ -178,6 +193,33 @@
   public void reset(ActionMapping mapping, HttpServletRequest request) {
  super.reset(mapping, request);
  page = 0;
  +   validatorResults = null;
  +}
  +
  +/**
  + * Get results of the validation performed by the 
  +

cvs commit: jakarta-struts/src/share/org/apache/struts/util StrutsValidator.java

2002-04-01 Thread dwinterfeldt

dwinterfeldt02/04/01 20:06:21

  Modified:src/share/org/apache/struts/util StrutsValidator.java
  Log:
  Changing interface to some methods to return correctly typed objects which are 
available in a Map using the property of the field as the key.  This Map can be 
accessed from the ValidatorForm.  The change should be transparent through the 
framework, but any direct method calls to these methods will need to be changed.  The 
change in the interface is to reduce duplication for Struts 1.1.
  
  Revision  ChangesPath
  1.2   +111 -89   
jakarta-struts/src/share/org/apache/struts/util/StrutsValidator.java
  
  Index: StrutsValidator.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/util/StrutsValidator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StrutsValidator.java  18 Mar 2002 01:42:51 -  1.1
  +++ StrutsValidator.java  2 Apr 2002 04:06:21 -   1.2
  @@ -56,16 +56,17 @@
   package org.apache.struts.util;
   
   import java.io.Serializable;
  +import java.util.Date;
   import java.util.Locale;
   import javax.servlet.ServletContext;
   import javax.servlet.http.HttpServletRequest;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogSource;
   import org.apache.commons.validator.Field;
  +import org.apache.commons.validator.GenericTypeValidator;
   import org.apache.commons.validator.GenericValidator;
   import org.apache.commons.validator.ValidatorAction;
   import org.apache.commons.validator.ValidatorUtil;
  -import org.apache.regexp.RESyntaxException;
   import org.apache.struts.action.ActionErrors;
   
   
  @@ -142,8 +143,6 @@
  } else {
 return true;   
  }
  - } catch (RESyntaxException e) {
  -LOG.error(e.getMessage(), e);
} catch (Exception e) {
   LOG.error(e.getMessage(), e);
}
  @@ -164,19 +163,23 @@
*  validation errors occur.
* @paramrequest Current request object.
   */
  -public static boolean validateByte(Object bean, 
  -  ValidatorAction va, Field field, 
  -  ActionErrors errors, 
  - HttpServletRequest request) {
  +public static Byte validateByte(Object bean, 
  + ValidatorAction va, Field field, 
  + ActionErrors errors, 
  +HttpServletRequest request) {
  
  +   Byte result = null;
  String value = ValidatorUtil.getValueAsString(bean, field.getProperty());
   
  -   if (!GenericValidator.isBlankOrNull(value) && 
!GenericValidator.isByte(value)) {
  -  errors.add(field.getKey(), StrutsValidatorUtil.getActionError(request, 
va, field));
  -  return false;
  -   } else {
  -  return true;   
  +   if (!GenericValidator.isBlankOrNull(value)) {
  +   result = GenericTypeValidator.formatByte(value);
  +   
  +   if (result == null) {
  + errors.add(field.getKey(), StrutsValidatorUtil.getActionError(request, 
va, field));
  +  }
  }
  +   
  +   return result;
   }
   
   /**
  @@ -190,18 +193,22 @@
*  validation errors occur.
* @paramrequest Current request object.
   */
  -public static boolean validateShort(Object bean, 
  -   ValidatorAction va, Field field, 
  -   ActionErrors errors, 
  -  HttpServletRequest request) {
  +public static Short validateShort(Object bean, 
  +   ValidatorAction va, Field field, 
  +   ActionErrors errors, 
  +  HttpServletRequest request) {
  +   Short result = null;
  String value = ValidatorUtil.getValueAsString(bean, field.getProperty());
  
  -   if (!GenericValidator.isBlankOrNull(value) && 
!GenericValidator.isShort(value)) {
  -  errors.add(field.getKey(), StrutsValidatorUtil.getActionError(request, 
va, field));
  -  return false;
  -   } else {
  -  return true;   
  +   if (!GenericValidator.isBlankOrNull(value)) {
  +   result = GenericTypeValidator.formatShort(value);
  +   
  +   if (result == null) {
  + errors.add(field.getKey(), StrutsValidatorUtil.getActionError(request, 
va, field));
  +  }
  }
  +   
  +   return result;
   }
   
   /**
  @@ -215,18 +222,22 @@
*  validation errors occur.
* @paramrequest Current requ

cvs commit: jakarta-struts/src/share/org/apache/struts/util StrutsValidatorUtil.java

2002-04-01 Thread dwinterfeldt

dwinterfeldt02/04/01 20:08:32

  Modified:src/share/org/apache/struts/util StrutsValidatorUtil.java
  Log:
  Adding version javadoc tag and revision/version header.
  
  Revision  ChangesPath
  1.2   +8 -1  
jakarta-struts/src/share/org/apache/struts/util/StrutsValidatorUtil.java
  
  Index: StrutsValidatorUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/util/StrutsValidatorUtil.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StrutsValidatorUtil.java  18 Mar 2002 01:42:51 -  1.1
  +++ StrutsValidatorUtil.java  2 Apr 2002 04:08:32 -   1.2
  @@ -1,4 +1,10 @@
   /*
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/util/StrutsValidatorUtil.java,v 
1.2 2002/04/02 04:08:32 dwinterfeldt Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/02 04:08:32 $
  + *
  + * 
  + *
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation.  All rights
  @@ -76,8 +82,9 @@
* This class helps provides some useful methods for retrieving objects 
* from different scopes of the application.
*
  - * @since 1.1
* @author David Winterfeldt
  + * @version $Revision: 1.2 $ $Date: 2002/04/02 04:08:32 $
  + * @since 1.1
   */
   public class StrutsValidatorUtil  {
   
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/nested/logic NestedMessagesNotPresentTag.java NestedMessagesPresentTag.java

2002-04-01 Thread dwinterfeldt

dwinterfeldt02/04/01 20:53:38

  Modified:src/share/org/apache/struts/taglib/nested/html
NestedErrorsTag.java NestedMessagesTag.java
   src/share/org/apache/struts/taglib/nested/logic
NestedMessagesNotPresentTag.java
NestedMessagesPresentTag.java
  Log:
  Fixed Javadoc description.
  
  Revision  ChangesPath
  1.3   +5 -5  
jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedErrorsTag.java
  
  Index: NestedErrorsTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedErrorsTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NestedErrorsTag.java  29 Mar 2002 21:49:09 -  1.2
  +++ NestedErrorsTag.java  2 Apr 2002 04:53:38 -   1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedErrorsTag.java,v
 1.2 2002/03/29 21:49:09 rleland Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/03/29 21:49:09 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedErrorsTag.java,v
 1.3 2002/04/02 04:53:38 dwinterfeldt Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/02 04:53:38 $
* 
*
* The Apache Software License, Version 1.1
  @@ -67,11 +67,11 @@
   import org.apache.struts.taglib.html.ErrorsTag;
   
   /**
  - * NestedTextTag.
  + * NestedErrorsTag.
* @author Arron Bates
* @author David Winterfeldt
* @since Struts 1.1
  - * @version $Revision: 1.2 $ $Date: 2002/03/29 21:49:09 $
  + * @version $Revision: 1.3 $ $Date: 2002/04/02 04:53:38 $
*/
   public class NestedErrorsTag extends ErrorsTag implements NestedPropertySupport {
   
  
  
  
  1.3   +5 -5  
jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedMessagesTag.java
  
  Index: NestedMessagesTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedMessagesTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NestedMessagesTag.java29 Mar 2002 21:49:09 -  1.2
  +++ NestedMessagesTag.java2 Apr 2002 04:53:38 -   1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedMessagesTag.java,v
 1.2 2002/03/29 21:49:09 rleland Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/03/29 21:49:09 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedMessagesTag.java,v
 1.3 2002/04/02 04:53:38 dwinterfeldt Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/02 04:53:38 $
* 
*
* The Apache Software License, Version 1.1
  @@ -67,11 +67,11 @@
   import org.apache.struts.taglib.html.MessagesTag;
   
   /**
  - * NestedTextTag.
  + * NestedMessagesTag.
* @author Arron Bates
* @author David Winterfeldt
* @since Struts 1.1
  - * @version $Revision: 1.2 $ $Date: 2002/03/29 21:49:09 $
  + * @version $Revision: 1.3 $ $Date: 2002/04/02 04:53:38 $
*/
   public class NestedMessagesTag extends MessagesTag implements NestedPropertySupport 
{
   
  
  
  
  1.2   +5 -5  
jakarta-struts/src/share/org/apache/struts/taglib/nested/logic/NestedMessagesNotPresentTag.java
  
  Index: NestedMessagesNotPresentTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/logic/NestedMessagesNotPresentTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NestedMessagesNotPresentTag.java  19 Mar 2002 06:45:11 -  1.1
  +++ NestedMessagesNotPresentTag.java  2 Apr 2002 04:53:38 -   1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/logic/NestedMessagesNotPresentTag.java,v
 1.1 2002/03/19 06:45:11 dwinterfeldt Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/19 06:45:11 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/logic/NestedMessagesNotPresentTag.java,v
 1.2 2002/04/02 04:53:38 dwinterfeldt Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/02 04:53:38 $
* 
*
* The Apache Software License, Version 1.1
  @@ -66,12 +66,12 @@
   import org.apache.struts.taglib.logic.MessagesNotPresentTag;
   
   /**
  - * NestedPresentTag.
  + * NestedMessagesNotPresentTag.
*
* @author Arron Bates
* @author David Winterfeldt
* @since Struts 1.1
  - * @version $Revision: 1.1 $ $Date: 2002/03/19 06:45:11 $
  + * 

Re: Jakarta Regexp Package Issue

2002-04-01 Thread David Winterfeldt

I checked in the changes in Commons Validator and
Struts to use Jakarta ORO.

David

--- David Winterfeldt <[EMAIL PROTECTED]> wrote:
> I'm planning on switching this over tonight.  I'm
> ready to check in the changes to Commons Validator. 
> The unit test I made shows that changing this fixes
> one of the e-mail bugs.  I'll also switch Struts to
> use ORO too.
> 
> David
> 
> --- Martin Cooper <[EMAIL PROTECTED]>
> wrote:
> > I have no problem with switching to ORO. Then
> again,
> > I must confess to
> > having no great knowledge of either package
> > (although I do use Regexp on one
> > of my projects). It's interesting that Regexp
> should
> > be considered lighter -
> > it's a significantly larger download than ORO!
> > 
> > I don't think we should allow the user to choose.
> It
> > would be confusing to
> > the user, and also to us when trying to track down
> > problems and subtle
> > differences in behaviour.
> > 
> > --
> > Martin Cooper
> > 
> > 
> > - Original Message -
> > From: "David Winterfeldt" <[EMAIL PROTECTED]>
> > To: "Struts Developers List"
> > <[EMAIL PROTECTED]>
> > Sent: Friday, March 22, 2002 7:56 AM
> > Subject: Jakarta Regexp Package Issue
> > 
> > 
> > > I'm reposting this.  It might be easily missed
> > since I
> > > forwarded the bug for this that I filed.
> > >
> > > Email Validation doesn't allow '-' in address. 
> > This
> > > is an error in the Jakarta Regexp package.  It
> > also
> > > has trouble with large max values.
> > >ex: ^\d{2,1000}$
> > >
> > > Does anyone think we should just switch to ORO? 
> > I'm
> > > leaning that way, but I used Jakarta Regexp
> > because it
> > > was considered 'lighter'.  If it isn't
> completely
> > > reliable, that doesn't really matter.  Or we
> could
> > > include both as an option, but I don't want to
> > confuse
> > > anyone.
> > >
> > > David
> > >
> > >
> > >
> > >
> __
> > > Do You Yahoo!?
> > > Yahoo! Movies - coverage of the 74th Academy
> > Awards®
> > > http://movies.yahoo.com/
> > >
> > > --
> > > To unsubscribe, e-mail:
> > 
> > > For additional commands, e-mail:
> > 
> > >
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> > 
> > For additional commands, e-mail:
> > 
> > 
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Greetings - send holiday greetings for
> Easter, Passover
> http://greetings.yahoo.com/
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: