RE: Alternative Frameworks

2001-03-13 Thread Flying Cloud

Expresso Framework - open source application development framework
www.jcorporate.com
> 30,000 downloads

Struts has complimentary aims to the Controller object in Expresso. An
effort is underway by Jcorporate to integrate Struts with Expresso.





Re: Checkboxs in a list

2001-03-13 Thread Martin Cooper

You can do this with the  tag.

- Use the same 'name' attribute for each checkbox.
- Use a different 'value' attribute for each checkbox (probably obtained
from your iterator).
- Define the corresponding bean property as type String[].

When the form is submitted, your property setter will be called with a
String array containing all of the values for the checkboxes which were
checked.

Hope this helps.

--
Martin Cooper


- Original Message -
From: "Paul Jackson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 13, 2001 4:00 PM
Subject: Checkboxs in a list


> Does anyone of the best approach for the following situation?
>
> I wish to have a list of files for processing with a checkbox on the left
> hand side of each file to indicate if the file should be processed or not.
> I'm looking at how to do this in a single form with a  tag
> to list the files.
>
> If I use the  tag the problem is that the names on the
> checkboxes are all the same and I can't distinguish between them.
>
> Any ideas?
>
>
>
> Paul Jackson
> Meridian Informatics
> Sydney, Australia
>
> Ph 8233 7564
> Fax 8233 7533
>
>





Re: trying to get started with Struts 1.0b1

2001-03-13 Thread Robert Leland

I had the exact similar problem a few weeks ago when trying to
build struts with ant. I was told that this usually happens
when either the xercies(sp ?) library is in the class path
before the jaxp.jar or there is an old parser.jar in the class path.
Either way it is a classpath problem, once I took care of that it 
worked ok.  I can't recall more, though I did get some insightful
explinations.

So search the struts www.mailing-archive.com for 'sealing violation'.
Also check the ant mailing list as I have sen this mentioned in there also.

-Rob 

Liz Anderson wrote:
> 
> Im trying to convert an example app that was running in struts .5 (its the
> auctionstation3 for those of you familiar with that example) to run in
> 1.0b1. I am getting the following error when i startup tomcat when it gets
> to my app:
> 
> Digester.getParser:
> java.lang.SecurityException: sealing violation
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:120)
> at
> javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:
> 92)
> at org.apache.struts.digester.Digester.getParser(Digester.java:244)
> at org.apache.struts.digester.Digester.parse(Digester.java:716)
> at
> org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java
> :1301)
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
> at javax.servlet.GenericServlet.init(GenericServlet.java:258)
> at
> org.apache.tomcat.core.ServletWrapper.initServlet(ServletWrapper.java
> :315)
> at
> org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java
> :276)
> at
> org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOn
> StartupInterceptor.java:132)
> at
> org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
> :227)
> at
> org.apache.tomcat.core.ContextManager.init(ContextManager.java:201)
> at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:156)
> at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
> 
> Have any of you ever seen this when starting tomcat? It does start and stays
> running, when I run my app I get more strange errors.
> Thanks for any help...
> 
> Liz



Re: Status of StrutsVersion 1.1

2001-03-13 Thread Craig R. McClanahan



On Tue, 13 Mar 2001, Rajan Gupta wrote:

> What is the status of Version 1.1 especially for the feature of Flow
> Processing? When is the development to start on this feature/phase?
> 

Discussions are welcome to start (on the STRUTS-DEV list) at any
time.  I'd like to hold off on checking in any code, though, until we
branch the CVS repository for Struts 1.0-beta-2 -- which would ideally
happen after we get done rearranging the build process to accomodate
future additions of unit tests.  This should happen fairly soon.

Craig




Re: trying to get started with Struts 1.0b1

2001-03-13 Thread Craig R. McClanahan



On Tue, 13 Mar 2001, Liz Anderson wrote:

> Im trying to convert an example app that was running in struts .5 (its the
> auctionstation3 for those of you familiar with that example) to run in
> 1.0b1. I am getting the following error when i startup tomcat when it gets
> to my app:
> 
> Digester.getParser:
> java.lang.SecurityException: sealing violation

The most common cause of "sealing violation" errors is when you have more
than one XML parser visible to your web application, and one of them is
the JAXP 1.0 or 1.1 release (in which jaxp.jar and crimson.jar are both
"sealed").

Since you are running Tomcat 3.x, the XML parser that it uses (normally
found in the $TOMCAT_HOME/lib directory) is already visible to web apps,
so you don't need to add a second one in WEB-INF/lib.

If that's not the problem, check your class path and/or system extensions
directory ($JAVA_HOME/jre/ilb/ext) for extra XML parsers.

> Liz

Craig
> 




RE: Alternative Frameworks

2001-03-13 Thread James Cook

I'll second WebWork. I really find it much simpler and equally as powerful
as struts. Much easier to get the ball rolling.

jim

> -Original Message-
> From: Jeff Schnitzer [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 13, 2001 3:43 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Alternative Frameworks
>
>
> Try WebWork:  http://www.sourceforge.net/projects/webwork
>
> Very, very similar to Struts but simpler (and easier).  Each have their
> plusses and minuses, IMHO.
>
> Jeff
>
> >-Original Message-
> >From: Perez, Bill [mailto:[EMAIL PROTECTED]]
> >Sent: Tuesday, March 13, 2001 10:54 AM
> >To: '[EMAIL PROTECTED]'
> >Subject: Alternative Frameworks
> >
> >
> >Does anyone know of some good JSP/Servlet MVC Frameworks
> >besides Struts?
> >




Re: Checkboxs in a list

2001-03-13 Thread Vinicios Torres

Im studying Struts yet, but I do this as follow:





To process all files marked (the files not marked doesnt appear:

String[] files = request.getParameterValues("file");
if (files != null) {
   for (int x = 0; x < files.length; x++) {
* process files[x];
   }
}


Is there another way more easily?
Is possible do the same thing with tag  ?



Vinicios Torres
ICHTUS Webmaster
[EMAIL PROTECTED]
http://www.ICHTUS.com.br

- Original Message - 
From: "Paul Jackson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 13, 2001 9:00 PM
Subject: Checkboxs in a list


> Does anyone of the best approach for the following situation?
> 
> I wish to have a list of files for processing with a checkbox on the left
> hand side of each file to indicate if the file should be processed or not.
> I'm looking at how to do this in a single form with a  tag
> to list the files. 
> 
> If I use the  tag the problem is that the names on the
> checkboxes are all the same and I can't distinguish between them.
> 
> Any ideas?
> 
> 
> 
> Paul Jackson
> Meridian Informatics
> Sydney, Australia
> 
> Ph 8233 7564
> Fax 8233 7533
> 
> 




Status of StrutsVersion 1.1

2001-03-13 Thread Rajan Gupta

What is the status of Version 1.1 especially for the feature of Flow
Processing? When is the development to start on this feature/phase?


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/



trying to get started with Struts 1.0b1

2001-03-13 Thread Liz Anderson

Im trying to convert an example app that was running in struts .5 (its the
auctionstation3 for those of you familiar with that example) to run in
1.0b1. I am getting the following error when i startup tomcat when it gets
to my app:

Digester.getParser:
java.lang.SecurityException: sealing violation
at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:
92)
at org.apache.struts.digester.Digester.getParser(Digester.java:244)
at org.apache.struts.digester.Digester.parse(Digester.java:716)
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java
:1301)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.initServlet(ServletWrapper.java
:315)
at
org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java
:276)
at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOn
StartupInterceptor.java:132)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
:227)
at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:201)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:156)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)

Have any of you ever seen this when starting tomcat? It does start and stays
running, when I run my app I get more strange errors.
Thanks for any help...

Liz














RE: Mismatch Between and

2001-03-13 Thread Michael McCallister

At 06:21 PM 3/13/2001, Craig wrote:
>I also think the current  behavior is more useful, and
>suggest that we change  to match.
>
>As a nod towards backwards compatibility, how about if we make
>smart enough, as a special case, so that if it receives a String it will 
>still be treated as a bean name? This behavior would be deprecated, but 
>would avoid instantly breaking old code. > Vic > Craig

Sounds good to me, since both tags support the name attribute.  This makes 
it relatively easy for current users of html:options to change their 
current code from:

 collection="myBeanName"

to

 name="myBeanName"

rather than to

 collection='<%= pageContext.getAttribute("myBeanName") %>'


Mike




RE: Mismatch Between and

2001-03-13 Thread Kyle Robinson

Sounds good to me...

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 16:21
To: '[EMAIL PROTECTED]'
Subject: RE: Mismatch Between  and 




On Tue, 13 Mar 2001, Fickes, Vic wrote:

> I agree that the mismatch is odd (ie. confusing),

You know how things get out of sync no matter how hard you try?  Well,
this was one of them :-(.

 but my vote would be to
> make the  collection attribute act like the 
> collection attribute.  My reasoning is that I have several static methods
> that return collections that could be used to populate the select lists,
and
> it would be nice to access them directly instead of having to get to them
> via a property in a bean.
> 

I also think the current  behavior is more useful, and
suggest that we change  to match.

As a nod towards backwards compatibility, how about if we make
 smart enough, as a special case, so that if it receives a
String it will still be treated as a bean name?  This behavior would be
deprecated, but would avoid instantly breaking old code.

> Vic
> 

Craig



RE: Mismatch Between and

2001-03-13 Thread Craig R. McClanahan



On Tue, 13 Mar 2001, Fickes, Vic wrote:

> I agree that the mismatch is odd (ie. confusing),

You know how things get out of sync no matter how hard you try?  Well,
this was one of them :-(.

 but my vote would be to
> make the  collection attribute act like the 
> collection attribute.  My reasoning is that I have several static methods
> that return collections that could be used to populate the select lists, and
> it would be nice to access them directly instead of having to get to them
> via a property in a bean.
> 

I also think the current  behavior is more useful, and
suggest that we change  to match.

As a nod towards backwards compatibility, how about if we make
 smart enough, as a special case, so that if it receives a
String it will still be treated as a bean name?  This behavior would be
deprecated, but would avoid instantly breaking old code.

> Vic
> 

Craig




RE: Mismatch Between and

2001-03-13 Thread Fickes, Vic

I agree that the mismatch is odd (ie. confusing), but my vote would be to
make the  collection attribute act like the 
collection attribute.  My reasoning is that I have several static methods
that return collections that could be used to populate the select lists, and
it would be nice to access them directly instead of having to get to them
via a property in a bean.

Vic

> -Original Message-
> From: Michael McCallister [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, March 13, 2001 6:58 PM
> To:   [EMAIL PROTECTED]
> Subject:  Mismatch Between  and 
> 
> Am I the only one who finds it odd that while both  and 
>  take a "collection" attribute, one expects a run-time 
> expression that evaluates to a Collection and the other takes a String
> that 
> names a bean in some scope that is a Collection?
> 
> Shouldn't these two tags play according to the same rules when it comes to
> 
> identically named attributes?  Should I file a bug for this?  Should one 
> behavior "win-out" over the other?  In my opinion, the behavior of naming 
> bean with a String attribute feels the most "Struts like".
> 
> Unfortunately, changing things one way or the other will break code, but 
> better to do so before cutting a release than after.
> 
> 
> Mike
> 



RE: Mismatch Between and

2001-03-13 Thread Kyle Robinson

I've noticed this too.  It's kinda annoying that you have to do a
 to make a  work and you don't to make a
 work.


-Original Message-
From: Michael McCallister [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 15:58
To: [EMAIL PROTECTED]
Subject: Mismatch Between  and 


Am I the only one who finds it odd that while both  and 
 take a "collection" attribute, one expects a run-time 
expression that evaluates to a Collection and the other takes a String that 
names a bean in some scope that is a Collection?

Shouldn't these two tags play according to the same rules when it comes to 
identically named attributes?  Should I file a bug for this?  Should one 
behavior "win-out" over the other?  In my opinion, the behavior of naming 
bean with a String attribute feels the most "Struts like".

Unfortunately, changing things one way or the other will break code, but 
better to do so before cutting a release than after.


Mike




Mismatch Between and

2001-03-13 Thread Michael McCallister

Am I the only one who finds it odd that while both  and 
 take a "collection" attribute, one expects a run-time 
expression that evaluates to a Collection and the other takes a String that 
names a bean in some scope that is a Collection?

Shouldn't these two tags play according to the same rules when it comes to 
identically named attributes?  Should I file a bug for this?  Should one 
behavior "win-out" over the other?  In my opinion, the behavior of naming 
bean with a String attribute feels the most "Struts like".

Unfortunately, changing things one way or the other will break code, but 
better to do so before cutting a release than after.


Mike





RE: More on my copyProperties/EJB woes

2001-03-13 Thread David Winterfeldt

I did the same thing on a project.  I had one method
to set and get a plain JavaBean.  I did use reflection
once I was inside the container managed EJB to
populate the values from the JavaBean to the EJB.

David

--- "Deadman, Hal" <[EMAIL PROTECTED]> wrote:
> 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 AM
> To: [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.IllegalArgumentException
> Message: object is not an instance of declaring
> class
> Stack: java.lang.IllegalArgumentException: object is
> not an instance of
> declaring class
> at 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
> 
> 
> 
> 


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/



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


Checkboxs in a list

2001-03-13 Thread Paul Jackson

Does anyone of the best approach for the following situation?

I wish to have a list of files for processing with a checkbox on the left
hand side of each file to indicate if the file should be processed or not.
I'm looking at how to do this in a single form with a  tag
to list the files. 

If I use the  tag the problem is that the names on the
checkboxes are all the same and I can't distinguish between them.

Any ideas?



Paul Jackson
Meridian Informatics
Sydney, Australia

Ph 8233 7564
Fax 8233 7533





Re: Getting Locale from a non-struts servlet

2001-03-13 Thread Incze Lajos

I would be pleased if I would be able to specify a default local 
in web.xml for struts (as an init parameter). All the other ways
can be late to override the system/servlet-engine default locale.
(E.g. if you use the servlet container's authentication the user
can enter at many different places and it is simply annoying to
start every action with locale checking.)

Every user sessions could inherit this value unless they override
in the http header or in some programmatic way. I can't see any
drawback but test the idea before applying a feature request on
Bugzilla. incze



RE: Alternative Frameworks - continued

2001-03-13 Thread Troy Hart

While the push model has traditionally been encouraged with Turbine, you can
also use pull-MVC model without any major problems. Whether the push or the
pull model is right for you depends on the nature of your application.

The learning curve associated with Turbine is a little steeper, but it is
also more powerful than struts. For one, you are not limited to JSP for the
presentation. In fact, I would imagine most people that use Turbine don't
use JSP. There is a slick templating language called Velocity
(http://jakarta.apache.org/velocity), and I would imagine that more often
than not this is used in favor of JSP with Turbine.

I am currently on a project using Turbine/Velocity and it works very well.
In all fairness it was a pain in the ass to overcome some of the
shortcomings in the documentation, some of it was outright misleading.
However, you should be able to come up to speed in a good day, or at most a
few of days

Good luck!

Troy

-Original Message-
From: Eric Brown [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 2:33 PM
To: Troy Hart
Subject: RE: Alternative Frameworks - continued


My team did an evaluation of Turbine and struts three months ago and Turbine
has some advantages, but while we had trouble getting both Turbine and
struts to work, Turbine was impossible while struts was merely difficult. I
also think the pull-MVC model that struts uses is superior in the long-run
to Turbine's push model.

I'm happy to report that my team is actively developing with struts and that
we have overcome the difficulties most usually have to overcome when
learning struts (and likely any new framework).

Bellow is my original message with comparison data, etc.

-Original Message-
From: Eric Brown
Sent: Monday, December 11, 2000 10:46 PM
To: Turbine; [EMAIL PROTECTED]
Cc: Yogieric (E-mail)
Subject: App framework eval: Turbine and/or Struts - Push vs. Pull MVC

I'm looking for an application framework for future work at my company and
am considering Turbine, Stuts and a few others. (My company currently uses
IIS/ASP/SQL Server and will move to apache/Java app server, Tomcat first and
Resin later as performance dictates, and Oracle.) Turbine seems to have the
most features including Torque (DB abstraction) and a personalization engine
that are important to me. However, as the push versus pull MVC paradigms
(http://java.apache.org/turbine/pullmodel.html) recently discussed on the
Turbine list concluded, Turbine's preferred UI language, Velocity, is a push
model that does not allow me to develop tag-like APIs for my UI/HTML
designers the way struts does, a pull MVC model. I believe Turbine allows
raw JSP that would allow me to use Turbine AND struts where appropriate
although I'm not sure that's the best answer either.

Pri Issue   ASP JSP Enhydra Struts  Turbine
XML/XSL
1   Separate UI from business logic XXX X   XXX
X
1   Database abstraction layer  XXX XXX
1   Reliable, Stable and scaleable  XXX XXX XXX ?   ?
?
1   Growth path X   XX  XX  XXX XXX
XX
1   Error validation and reporting  ?   X?  ?
1   Error message separation?   ?   ?
1   Reasonably Fast XXX XXX ?   ?   ?
X?
2   Very Fast   XX  XX  ?   ?   ?
?
2   Personalization Engine  X
2   Source code availabilityX   X   XX  XXX
X
2   Longevity -- Been aroundXXX XX  XX  X   X
X
2   Code reusabilityXXX XXX XX
XX
2   Documentation   XXX XXX XX  X   X
XX
2   HTML form rich API  ?   X?  ?
2   Early compilation   XXX ?   ?
XX
2   Vendor Freedom  X   XXX XX  XXX XXX
XXX
2   MVC Pull model  ?   XXX ?
3   MVC Push model  ?   XXX
XX
3   Strict API enforcement  XXX XXX
XXX
3   API Extensibility   XXX XXX X
XX
3   Internationalization?   X?  X?
X
3   File Upload API ?   ?   X?

I've tried to note what I know exists in each framework. The legend is as
follows:
X - Feature exists
XX - Feature exists and is reasonably good
XXX - Feature exists and is great
? - Feature might exist, unsure
X? - Feature exists but quality is unknown

ASP - IIS, ChiliSoft, Perl::ASP
Straight JSP - See www.javasoft.com
Enhydra - See www.enhydra.org
Struts - See jakarta.apache.org
Turbine - See java.apache.org
XML/XSL - M$ Implements on ASP, Cocoon (java.apache.org), Resin
(www.caucho.com)

Other priorities relevant to web

RE: Alternative Frameworks - continued

2001-03-13 Thread Eric Brown

My team did an evaluation of Turbine and struts three months ago and Turbine
has some advantages, but while we had trouble getting both Turbine and
struts to work, Turbine was impossible while struts was merely difficult. I
also think the pull-MVC model that struts uses is superior in the long-run
to Turbine's push model.

I'm happy to report that my team is actively developing with struts and that
we have overcome the difficulties most usually have to overcome when
learning struts (and likely any new framework).

Bellow is my original message with comparison data, etc.

-Original Message-
From: Eric Brown 
Sent: Monday, December 11, 2000 10:46 PM
To: Turbine; [EMAIL PROTECTED]
Cc: Yogieric (E-mail)
Subject: App framework eval: Turbine and/or Struts - Push vs. Pull MVC

I'm looking for an application framework for future work at my company and
am considering Turbine, Stuts and a few others. (My company currently uses
IIS/ASP/SQL Server and will move to apache/Java app server, Tomcat first and
Resin later as performance dictates, and Oracle.) Turbine seems to have the
most features including Torque (DB abstraction) and a personalization engine
that are important to me. However, as the push versus pull MVC paradigms
(http://java.apache.org/turbine/pullmodel.html) recently discussed on the
Turbine list concluded, Turbine's preferred UI language, Velocity, is a push
model that does not allow me to develop tag-like APIs for my UI/HTML
designers the way struts does, a pull MVC model. I believe Turbine allows
raw JSP that would allow me to use Turbine AND struts where appropriate
although I'm not sure that's the best answer either.

Pri Issue   ASP JSP Enhydra Struts  Turbine
XML/XSL
1   Separate UI from business logic XXX X   XXX
X
1   Database abstraction layer  XXX XXX 
1   Reliable, Stable and scaleable  XXX XXX XXX ?   ?
?
1   Growth path X   XX  XX  XXX XXX
XX
1   Error validation and reporting  ?   X?  ?   
1   Error message separation?   ?   ?   
1   Reasonably Fast XXX XXX ?   ?   ?
X?
2   Very Fast   XX  XX  ?   ?   ?
?
2   Personalization Engine  X   
2   Source code availabilityX   X   XX  XXX
X
2   Longevity -- Been aroundXXX XX  XX  X   X
X
2   Code reusabilityXXX XXX XX
XX
2   Documentation   XXX XXX XX  X   X
XX
2   HTML form rich API  ?   X?  ?   
2   Early compilation   XXX ?   ?
XX
2   Vendor Freedom  X   XXX XX  XXX XXX
XXX
2   MVC Pull model  ?   XXX ?   
3   MVC Push model  ?   XXX
XX
3   Strict API enforcement  XXX XXX
XXX
3   API Extensibility   XXX XXX X
XX
3   Internationalization?   X?  X?
X
3   File Upload API ?   ?   X?  

I've tried to note what I know exists in each framework. The legend is as
follows:
X - Feature exists
XX - Feature exists and is reasonably good
XXX - Feature exists and is great
? - Feature might exist, unsure
X? - Feature exists but quality is unknown

ASP - IIS, ChiliSoft, Perl::ASP
Straight JSP - See www.javasoft.com
Enhydra - See www.enhydra.org
Struts - See jakarta.apache.org
Turbine - See java.apache.org
XML/XSL - M$ Implements on ASP, Cocoon (java.apache.org), Resin
(www.caucho.com)

Other priorities relevant to web server, internal process, etc., but not to
application framework:
Priority - Issue
1 - Staff Training Resources
1 - Must run in J2EE environment (Tomcat 3.2)
1 - Portability, ability to migrate from NT to UNIX easily
1 - Security
2 - Easy Deployment
2 - Logging/audit system
2 - Ability to debug
2 - Search
3 - Voice/WML/Alternate presentation format support
3 - Reporting system
4 - Content Management (other than Perforce)



-Original Message-
From: Richard Yumul [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 1:15 PM
To: [EMAIL PROTECTED]
Subject: Alternative Frameworks - continued

Does anybody have comparisons betweeen Turbine & Struts?

Rich

Richard M. Yumul
Polexis, Inc.
Direct: 619-542-7209
Fax: 619-542-8675
http://www.polexis.com
transforming data into knowledge 



Re: Getting the tag to display on multiple lines

2001-03-13 Thread Michael McCallister

Just specify the property attribute of the html:errors tag.  So, for 
example, in your validate function you might have something like:

 errors.add("roles", new 
ActionError("error.reqaccess.role.invalid"));

to indicate an error in the "roles" field.  Using:

 

in your JSP will show only the errors associated with the roles 
field.  Repeat this for as many fields as you have and use the appropriate 
parameters to errors.add(), and you should be able to place errors in the 
appropriate locations.


Mike

At 02:12 PM 3/13/2001, you wrote:
>Hello,
>
>I guess this is kind of a trivial question, but I'm having a problem getting
>the
>"html:errors" tag to display on multiple lines for multiple errors. Am I
>overlooking
>something obvious, or do I have to use the iterator tag and parse the errors
>myself if
>I want them on separate lines? If you could respond directly to me at:
>
>[EMAIL PROTECTED]
>
>Thanks
>Justin




Alternative Frameworks - continued

2001-03-13 Thread Richard Yumul

Does anybody have comparisons betweeen Turbine & Struts?

Rich

Richard M. Yumul
Polexis, Inc.
Direct: 619-542-7209
Fax: 619-542-8675
http://www.polexis.com
transforming data into knowledge  



RE: Alternative Frameworks

2001-03-13 Thread Jeff Schnitzer

Try WebWork:  http://www.sourceforge.net/projects/webwork

Very, very similar to Struts but simpler (and easier).  Each have their
plusses and minuses, IMHO.

Jeff

>-Original Message-
>From: Perez, Bill [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, March 13, 2001 10:54 AM
>To: '[EMAIL PROTECTED]'
>Subject: Alternative Frameworks
>
>
>Does anyone know of some good JSP/Servlet MVC Frameworks 
>besides Struts?
>



Re: DefineTag.value question (proposal)

2001-03-13 Thread Johan Compagner

> > so not:
> > 
> >  // Retrieve the required property value
> >  Object value = this.value;
> 
> This will return null if you did not specify a "value" attribute, so the
> effect is the same as your desired result -- setting the new bean based on
> the name/property combination.


This is not my desired result because i want it to be a default value.
It should not ignore the name and property attributes if they are specified.


> >  // Retrieve the required property value
> >  Object value = null;
> > if(name != null)
> > value = RequestUtils.lookup(pageContext, name, property, scope);
> >  if (value == null)
> >   value = this.value;
> > 
> 
> This would reverse the priority of lookups, and make the string you
> specified for the "value" essentially a default if the specified property
> returns null.  That is different from the current behavior, and different
> from what is documented, but makes a certain kind of sense.

But the behaviour is not changed for all the application build today 
because None in using a name, value combo because at this time
that combo doesn't make any sense because it doesn't do a thing.

 
> What do people think about changing this?

You got my vote!

johan





RE: Alternative Frameworks

2001-03-13 Thread Troy Hart

Try turbine: http://jakarta.apache.org/turbine/.

-Original Message-
From: Perez, Bill [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 11:54 AM
To: Troy Hart
Subject: Alternative Frameworks


Does anyone know of some good JSP/Servlet MVC Frameworks besides Struts?




RE: Struts with IBM WebSphere 3.5.3

2001-03-13 Thread Perez, Bill

when i deployed the struts-test app on websphere 3.5.3, i get a
ParseException thrown when it tries to read the struts-config.xml.  also, it
did not work out of the box for me.. i had to modify the struts source to
not use getResourceAsStream() as described in the struts installation docs. 

has anyone else had this prob?

-Original Message-
From: Markus Torpvret [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 12:03 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Struts with IBM VisualAge for Java


We're running Struts 1.0-beta-1 with WebSphere 3.5.3 (the new fixpack 3) and
it works pretty well out of the box. We're not using VisualAge though.

/Markus

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 13, 2001 5:04 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: Struts with IBM VisualAge for Java
> 
> 
> There are known issues with WAS 3.5.2 and struts, as WAS 
> 3.5.2 does not 
> completely implement Servlet 2.2.
> 
> Please see the install instructions off the struts home page 
> for the exact 
> details.
> --
> dIon Gillard, Multitask Consulting
> Work:  http://www.multitask.com.au
> NetRexx: http://www.multitask.com.au/NetRexx.nsf
> 
> 
> 
> 
> [EMAIL PROTECTED]
> 13/03/2001 05:37 AM
> Please respond to struts-user
> 
>  
> To: [EMAIL PROTECTED]
> cc: 
> Subject:RE: Struts with IBM VisualAge for Java
> 
> 
> No, WAS 3.5 supports Servlet API 2.2 with fixpack 2.
> 
> - Magnus
> 
> -Original Message-
> From: Perez, Bill [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 12, 2001 7:34 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Struts with IBM VisualAge for Java
> 
> 
> Well, I eventually have to deploy to WebSphere for 
> production.. do you 
> think
> that will be a problem?
> 
> -Original Message-
> From: Nick Chalko [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 12, 2001 10:32 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Struts with IBM VisualAge for Java
> 
> 
> I have TOMCAT running in VAJ 3.5.  You have to delete the Servlet 2.1 
> stuff
> before you install TOMCAT.
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 12, 2001 10:27 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Struts with IBM VisualAge for Java
> 
> 
> Apache Tomcat Test Environment 3.1 is avialable as a VAJ 
> feature from IBM.
> 
> http://www7.software.ibm.com/vad.nsf/
> 
> - Magnus
> 
> -Original Message-
> From: Perez, Bill [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 12, 2001 7:15 PM
> To: '[EMAIL PROTECTED]'
> Subject: Struts with IBM VisualAge for Java
> 
> 
> I can't seem to get Struts to work with VisualAge for Java 3.5.  The
> WebSphere Test Environment only supports the Servlet 2.1 API.  I can't
> replace it with 2.2.  Is there anyway to get this working???
> 
> Billy Perez
> Java Developer, e-ARCS
> 
> 
> 



RE: Alternative Frameworks

2001-03-13 Thread Perez, Bill

yes, this article is where i discovered struts in the first place... but it
didn't seem to mention other frameworks like struts.  is that because there
really aren't any???

-Original Message-
From: Marci Kickliter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 11:26 AM
To: [EMAIL PROTECTED]
Subject: RE: Alternative Frameworks


I found a good article on javaworld.com that reviews some techniques for
implementing content presentation.

http://www.javaworld.com/javaworld/jw-11-2000/jw-1103-presentation.html

Marci Kickliter
> -Original Message-
> From: Perez, Bill [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, March 13, 2001 1:54 PM
> To:   '[EMAIL PROTECTED]'
> Subject:  Alternative Frameworks
> 
> Does anyone know of some good JSP/Servlet MVC Frameworks besides Struts?



Getting the tag to display on multiple lines

2001-03-13 Thread Justin Forys

Hello,

I guess this is kind of a trivial question, but I'm having a problem getting
the
"html:errors" tag to display on multiple lines for multiple errors. Am I
overlooking
something obvious, or do I have to use the iterator tag and parse the errors
myself if
I want them on separate lines? If you could respond directly to me at: 

[EMAIL PROTECTED]

Thanks
Justin

 winmail.dat


Re: DefineTag.value question (proposal)

2001-03-13 Thread Craig R. McClanahan



On Tue, 13 Mar 2001, Johan Compagner wrote:

> Hi,
> 
> If i specify the value in the DefineTag then the name/property is ignored!!
> But when i also specify the name/property then i want the value to be filled in when
> name/property seems to be null!
> 

If you specify the "value" attribute:



you are saying that you want to create a bean under key "xyz" with the
specified literal String value "this is a value".  That is why any
"name" or "property" attributes are ignored.

> so not:
> 
>  // Retrieve the required property value
>  Object value = this.value;

This will return null if you did not specify a "value" attribute, so the
effect is the same as your desired result -- setting the new bean based on
the name/property combination.

>  if (value == null)
>   value = RequestUtils.lookup(pageContext, name, property, scope);
> 
> but:
> 
>  // Retrieve the required property value
>  Object value = null;
> if(name != null)
> value = RequestUtils.lookup(pageContext, name, property, scope);
>  if (value == null)
>   value = this.value;
> 

This would reverse the priority of lookups, and make the string you
specified for the "value" essentially a default if the specified property
returns null.  That is different from the current behavior, and different
from what is documented, but makes a certain kind of sense.

What do people think about changing this?

> johan
> 
> 
> 

Craig





Re: html:link

2001-03-13 Thread Rajan Gupta

Excellent and Thanks
--- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
> 
> 
> On Tue, 13 Mar 2001, Rajan Gupta wrote:
> 
> > Hi! All,
> > The mail reader documentation suggests that html:link encodes the
> session
> > id with the link if the browser has turned off cookies. What does it
> mean
> > by saying
> > "Automatically URL-encodes hyperlinks as needed"
> > 
> > Does it depend upon if cookies are enabled or not? But I could not see
> > that in the code, I think it always encodes the url regardless.
> > 
> > Any insight on this or I am missing something?
> > 
> 
> It is a clumsy way of saying that Struts always calls
> response.encodeURL() or response.encodeRedirectURL() for you.
> 
> Whether the session ID actually shows up in the generated hyperlink or
> not
> depends on whether the servlet container thinks your client has cookies
> enabled or not.  On the first response that is part of the session, the
> container has no way to know - so it sends the session ID both ways (as
> a
> cookie and in the URL).  If the second request contains the session
> cookie, the container says "aha, this client supports cookies" so it
> stops
> modifying the generated URLs on hyperlinks.  The call to
> response.encodeURL() is still happening; it is just returning the URL
> without modifying it.
> 
> See the Servlet Specification, version 2.2, for more information about
> how
> session tracking works.
> 
>   http://java.sun.com/products/servlet/download.html
> 
> 
> > Thanks
> > Rajan
> > 
> 
> Craig McClanahan
> 


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/



DefineTag.value question (proposal)

2001-03-13 Thread Johan Compagner

Hi,

If i specify the value in the DefineTag then the name/property is ignored!!
But when i also specify the name/property then i want the value to be filled in when
name/property seems to be null!

so not:

 // Retrieve the required property value
 Object value = this.value;
 if (value == null)
  value = RequestUtils.lookup(pageContext, name, property, scope);

but:

 // Retrieve the required property value
 Object value = null;
if(name != null)
value = RequestUtils.lookup(pageContext, name, property, scope);
 if (value == null)
  value = this.value;

johan





RE: Alternative Frameworks

2001-03-13 Thread Marci Kickliter

I found a good article on javaworld.com that reviews some techniques for
implementing content presentation.

http://www.javaworld.com/javaworld/jw-11-2000/jw-1103-presentation.html

Marci Kickliter
> -Original Message-
> From: Perez, Bill [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, March 13, 2001 1:54 PM
> To:   '[EMAIL PROTECTED]'
> Subject:  Alternative Frameworks
> 
> Does anyone know of some good JSP/Servlet MVC Frameworks besides Struts?



Alternative Frameworks

2001-03-13 Thread Perez, Bill

Does anyone know of some good JSP/Servlet MVC Frameworks besides Struts?



Passing on multi-select values from form to form

2001-03-13 Thread Martijn Spronk

I have a form that submits from the form page to an interrim 'confirm/edit'
page it and from there goes to a save page. (Ofcourse it has a Form bean
attached 
to it).

However, it seems I need to pass on the initial values useing html:hidden
tags
from the Form when selecting Edit on the confirm page (going back to the
Form page) .

First question, is that the right way to do it? If I don't do it, 
the Form page tries to populate the form again and starts from scratch
populating the form even though the form already exists populated.

Second problem. If I DO use the html:hidden tags it seems I can't
pass on any multi-select values because the html:hidden tag only supports
Strings. I guess this is inevitable?

Martijn.


Martijn Spronk
[EMAIL PROTECTED]
www.columbusgroup.com
604.801.5758 ext. 248
Vancouver + Toronto + Seattle



Re: Digester order of events

2001-03-13 Thread Zach Thompson

Actually, there's a setter in MyBean (setProp) but no corresponding "prop"
attribute in the XML.  At runtime, the JVM can't find type SomeType, and
it looks like that causes Digester to not ever call setName().  If I
comment out the first 4 lines of the MyBean class (all the
SomeType/setProp stuff), things will work.  Also, if I add type SomeType
to my runtime CLASSPATH, things will work.  Please note that I had an error
in my original post: I never actually do "SomeType p = new SomeType();"
(that line should be "SomeType p;"), that's why there isn't a runtime error.

[EMAIL PROTECTED] wrote:
> Regarding your first point, are you saying "There's a name attribute in the 
> XML, but there's no corresponding setter, so the Digester should flag an 
> error"? If not, I apologise for putting words in your mouth. :-}
> 
> One of the nice things about the Digester is that I can tell it which 
> pieces of the XML I care about, and that's all it calls me about. If I 
> don't care about the value of a certain attribute, I shouldn't need to 
> provide for it. So I consider that a feature rather than a problem.
> 
> --
> Martin Cooper
> 
> At 06:12 PM 3/12/01, Zach Thompson wrote:
> >Hello,
> >
> >I just spent quite a bit of time debugging some code that uses a
> >Digester, and I'd like to share what I found.
> >
> >class MyBean {
> > SomeType p = new SomeType();
> > public void setProp(SomeType p) {
> > this.p = p;
> > }
> >
> > String name;
> > public void setName(String name) {
> > System.err.println("Setting name...");
> > this.name = name;
> > }
> >}
> >
> >...
> >
> >
> >
> >...
> >
> >digester.addSetProperties("mybean");
> >
> >The name property was never being set..
> >
> >The problem was that SomeType was not in my runtime CLASSPATH, so even
> >though setProp() is never called, and hence no runtime error occurs,
> >Digester fails to ever call setName().  Of course, the error here is
> >really mine, but I'd like to at least see Digester give some debugging
> >messages (I had debug detail set to 999).
> >
> >2.  Next I was trying to get the body of a tag and set a bean property
> >with the content:
> >
> >Some content
> >
> >...
> >
> >digester.addSetProperties("mybean");
> >digester.addCallMethod("mybean", "setBody", 0);
> >digester.addSetNext("mybean", "addMyBean");
> >
> >I discovered that at the point addMyBean() is called, setBody() has not
> >been called yet.  I realize that I'm just setting up a Digester
> >here (not actually doing the parsing), so I can imagine that the order of
> >events is not really defined here.  However, it seems like the parsing
> >should generally follow the order that I set up the Digester in.  Am I
> >missing something?
> >
> >Anyway, I'll look at the struts source and see if I can come up with
> >suggestions or patches for struts-dev, but I thought I'd share this info
> >in case it helps anyone.
> >
> >Zach
> 
> 



Re: Access to ApplicationResources.properties from Action class?

2001-03-13 Thread Mikael Eriksson


 Your right of course. Seems that I answered the question a bit too
quickly, my eyes focues on the code example and I lept to conclusions
from that :-(


 Regards
 Mikael

Martijn Spronk wrote:

> > I think that the best thing to do would be to not use the text of
> >the button at all. If you use the text you will need to change the
> >code as well if you decide to change the text on the button by
> >editing the property file. (And if you get internationalization into
> >the picture it will be even worse.)
>
> I disagree on this.
>
> By accessing the properties file I am actually avoiding having
> to modify the code if the button text changes. After all, I am accessing
> the property from the JSP using a tag, and what I try to do in the perform
> method is the same: access the value of the property.




Re: html:link

2001-03-13 Thread Craig R. McClanahan



On Tue, 13 Mar 2001, Rajan Gupta wrote:

> Hi! All,
> The mail reader documentation suggests that html:link encodes the session
> id with the link if the browser has turned off cookies. What does it mean
> by saying
> "Automatically URL-encodes hyperlinks as needed"
> 
> Does it depend upon if cookies are enabled or not? But I could not see
> that in the code, I think it always encodes the url regardless.
> 
> Any insight on this or I am missing something?
> 

It is a clumsy way of saying that Struts always calls
response.encodeURL() or response.encodeRedirectURL() for you.

Whether the session ID actually shows up in the generated hyperlink or not
depends on whether the servlet container thinks your client has cookies
enabled or not.  On the first response that is part of the session, the
container has no way to know - so it sends the session ID both ways (as a
cookie and in the URL).  If the second request contains the session
cookie, the container says "aha, this client supports cookies" so it stops
modifying the generated URLs on hyperlinks.  The call to
response.encodeURL() is still happening; it is just returning the URL
without modifying it.

See the Servlet Specification, version 2.2, for more information about how
session tracking works.

http://java.sun.com/products/servlet/download.html


> Thanks
> Rajan
> 

Craig McClanahan




Re: Getting Locale from a non-struts servlet

2001-03-13 Thread Craig R. McClanahan



On Tue, 13 Mar 2001, Neal Kaiser wrote:

> Does Struts store the client's Locale in their session somewhere? If so, how
> would
> I access it?
> 

Yes, it does.  Look for a java.util.Locale object stored as a session
attribute under key "org.apache.struts.action.LOCALE".  In a program, you
could use the symbolic string constant Action.LOCALE_KEY instead (from the
org.apache.struts.action.Action class).

Be sure that you enable Locale tracking if you want this to work, by
setting the appropriate initialization parameter for the controller
servlet (parameter "locale" should have a value of "true").  Also, if the
first request in your session is to a JSP page instead of the controller
servlet, you can have the page save the Locale by using tag:


... contents of your page


around it.

> I have a non-struts servlet which I want to try to pull the Locale object
> from.
> 
> Thanks,
> 
> Neal
> 
> 

Craig McClanahan





diiferent html tags packages -thanks

2001-03-13 Thread Sarbjit Singh



Thanks for the quik 
replies.


Re: More on my copyProperties/EJB woes

2001-03-13 Thread Craig R. McClanahan



On Mon, 12 Mar 2001, Bryan Field-Elliot wrote:

> 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.IllegalArgumentException
> Message: object is not an instance of declaring class
> Stack: java.lang.IllegalArgumentException: object is not an instance of 
> declaring class
> at 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).
> 

This is definitely strange.  How is your bean class declared?  Does it say
"public class Xyz" at the top?  Does it implement one or more interfaces?

It would be really helpful if you could post a bug report to our bug
tracking system  with a sample bean
class that illustrates the problem.

> Regards,
> Bryan
> 
> 

Craig McClanahan





Re: problem with using redirect tag

2001-03-13 Thread Craig R. McClanahan



On Tue, 13 Mar 2001, kiatkin wrote:

> >>Query string is valueA=aaa&valueB=
> 
> Thx for reply.. but this causing me can't retrieve the second parameter
> (valueB)
> 
>servlet.log("value A "+ request.getParameter("valueA"));
>servlet.log("value B " +request.getParameter("valueB"));
> 
> The output is
> value A aaa
> value B null
> 
> It is bug?
> 

Yes, it appears to be a bug.  The "&" sequence is what you get when
you URL-encode a string containing an ampersand, and it looks like Struts
is doing that a little bit too aggressively.

Could you please report a bug to our bug tracking system?

http://nagoya.apache.org/bugzilla/

That way, it will be sure to be paid attention to.  Sometimes, bug reports
on the mailing lists get lost in the volume of messages.

Thanks,
Craig McClanahan




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: diiferent html tags packages?

2001-03-13 Thread Rob Leland



> Sarbjit Singh wrote:
> 
> hi,
> What is the actual intention or actual diferences between the tags in
> the:
> org.apache.strtus.taglibs.*
Struts 0.5   org.apache.strtus.taglibs.html.* <--- Newest
Struts 1.0

> org.apache.strtus.taglibs.form.*
Struts 0.7, ie after 0.5 but not 1.0  <--- old, incorrectly named

> ?
> 
> 
> 
>



diiferent html tags packages?

2001-03-13 Thread Sarbjit Singh



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: Strut Books

2001-03-13 Thread Martijn Spronk

Here is some input from someone who started using
struts from scratch a week ago. So it might be valuable.

In a book on struts, I think it would be really good to 
emphasize on the 'why' and not only on the 'how'.

What I find with a lot of information and examples on
the struts site is that there is a lot of information on
how to do certain things (with a lot of examples) which is
pretty good. But because there is a lack of explaining 'why'
things work the way they work, it is not always easy to go
beyond functionality that is used in the examples. Simply
because the user is not always informed on why the things
work the way they work.


Martijn

Martijn Spronk
[EMAIL PROTECTED]
www.columbusgroup.com
604.801.5758 ext. 248
Vancouver + Toronto + Seattle


-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: March 13, 2001 7:49 AM
To: [EMAIL PROTECTED]
Subject: Re: Strut Books


Julia Reynolds wrote:
> Also, many people who visit this list need ammunition to convince
> their management to
> use the struts framework in an upcoming project, so a "Why do I need
> Struts" section with a compelling case study or two would be a good
> idea.

"Why You Need Struts" is also (now) a good subtitle to Jason Hunter's
seminal JSP critique. 

< http://www.servlets.com/soapbox/problems-jsp.html >

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



Re: html:link

2001-03-13 Thread James Cook

The servlet container implements the encodeURL method.

If yo want to see the implementation, check out the encodeURL() method at:

http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat-4.0/catalina/src/share
/org/apache/catalina/connector/HttpResponseBase.java?rev=1.27&content-type=text/
vnd.viewcvs-markup

jim

- Original Message -
From: "Rajan Gupta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 13, 2001 10:22 AM
Subject: html:link
> Hi! All,
> The mail reader documentation suggests that html:link encodes the session
> id with the link if the browser has turned off cookies. What does it mean
> by saying
> "Automatically URL-encodes hyperlinks as needed"
>
> Does it depend upon if cookies are enabled or not? But I could not see
> that in the code, I think it always encodes the url regardless.
>
> Any insight on this or I am missing something?
>
> Thanks
> Rajan
>
>
> __
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/




Re: Strut Books

2001-03-13 Thread Ted Husted

Julia Reynolds wrote:
> Also, many people who visit this list need ammunition to convince
> their management to
> use the struts framework in an upcoming project, so a "Why do I need
> Struts" section with a compelling case study or two would be a good
> idea.

"Why You Need Struts" is also (now) a good subtitle to Jason Hunter's
seminal JSP critique. 

< http://www.servlets.com/soapbox/problems-jsp.html >

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



html:link

2001-03-13 Thread Rajan Gupta

Hi! All,
The mail reader documentation suggests that html:link encodes the session
id with the link if the browser has turned off cookies. What does it mean
by saying
"Automatically URL-encodes hyperlinks as needed"

Does it depend upon if cookies are enabled or not? But I could not see
that in the code, I think it always encodes the url regardless.

Any insight on this or I am missing something?

Thanks
Rajan


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/



Re: Strut Books

2001-03-13 Thread Julia Reynolds


For Beginners:


Getting started with Struts...a walk through of setting up a simple Struts
application


Explanation of the xml config files


How Action Servlet works


Brief explanation of the components needed like Xerces and Xalan


Life Cycle of a form submission including the execution of the Action class

For More Advanced Users:


Extending Struts


How the Digester works


Struts with various application servers, common workarounds to problems


Using JUNIT to test Struts applications.  This topic alone would make
the book worth buying for me!

Also, many people who visit this list need ammunition to convince their
management to
use the struts framework in an upcoming project, so a "Why do I need
Struts" section with a compelling case study or two would be a good idea.
Good luck, I hope to be writing you to request an autographed copy some
day soon!
Julia
"Lacerda, Wellington (AFIS)" wrote:
I'm working on a book about tag libraries that has
quite a number of
chapters dedicated to Struts. What are the topics you want to be covered
with more detail? I'm still working on those chapters to have them
more
up-to-date! This kind of input would be nice and right in time! :-)
Wellington Silva
UN/FAO
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 09/03/01 22:16
Subject: Re: Strut Books
If someone wrote one, I would buy it and my company would probably want
one for each developer.  I would buy the hardback, even! 
What about it
Craig?
Julia
Spencer Smith wrote:
> Don't I wish!
>
> - Original Message -
> From: "Marty Fisher" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, March 09, 2001 12:36 PM
> Subject: Strut Books
>
> > Hello,
> >
> > Are there any decent books on the market now that give you a
detailed
> > account of how to modify/extend/use the strut classes ?
> >
> > Thanks,
> > Marty
> >
> >
--
In a time of drastic change it is the learners who inherit the future.
The
learned find themselves equipped to live in a world that no longer
exists.
- Eric Hoffer
  H e a l t h S t r e a m,   I n c.
  Julia Reynolds - Systems Developer
  209 10th Ave. South Ste. 450 - Nashville, TN 37203
  phone: (615) 301-3220 - fax: (615) 301-3200
  email: [EMAIL PROTECTED]
  Web Site: http://www.cmecourses.com

--
In a time of drastic change it is the learners who inherit the future.
The learned find themselves equipped to live in a world that no longer
exists. - Eric Hoffer
 
 
  H e a l t h S t r e a m,   I n c.
  Julia Reynolds - Systems Developer
  209 10th Ave. South Ste. 450 - Nashville, TN 37203
  phone: (615) 301-3220 - fax: (615) 301-3200
  email: [EMAIL PROTECTED]
  Web Site: http://www.cmecourses.com
 



Getting Locale from a non-struts servlet

2001-03-13 Thread Neal Kaiser

Does Struts store the client's Locale in their session somewhere? If so, how
would
I access it?

I have a non-struts servlet which I want to try to pull the Locale object
from.

Thanks,

Neal




RE: Struts with IBM VisualAge for Java

2001-03-13 Thread Hines, Bill

I said it is 'imminent' - meaning it should be out any time now but it is
not out yet. Keep looking and also you might get more info on IBM's
newsgroups.

Bill Hines
Hershey Foods

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 2:31 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts with IBM VisualAge for Java

>yet. There is also an imminent fixpack for VisualAge Java's WebSphere Test
>Environment to bring it to servlet 2.2 and JSP 1.1, so that you don't have
>to use Tomcat instead.

Is that an official fixpack from IBM? Because I cant find it at there site.

- Magnus

>
>Bill Hines
>Hershey Foods



Re: Question about struts application model (DataSource, Business Logic beans)

2001-03-13 Thread Ted Husted

> My problem is that
> access to the DataSource is through the servlet.findDataSource() call.

Struts stores the JDBC Connection pools as servlet context attributes
(in JSP terms, application-scope beans). You can also access them that
way. If you do not specify a name in the Struts-config file, it uses a
constant value. If you specify null to findDataSource(), it uses the
same constant. But you can also access the pools using your own labels
(or the Struts constant) without using the servlet method. 

> Carles Pi-Sunyer wrote:
> 
> Hi,
> 
> I'm using Struts for a new application that I'm developing. I have a
> question about the separation between the Action classes and the
> Business Logic beans.
> 
> My Business Logic beans are making database accesses to manipulate the
> underlying data model. I am planning on using the struts db connection
> pool, which is supplied through the DataSource. My problem is that
> access to the DataSource is through the servlet.findDataSource() call.
> How do I make the Business Logic beans unaware of the servlet/http
> layer (as suggested in the developers guide) while still making the
> DataSource available to the Business Logic beans? Do I have to pass a
> reference to the DataSource on every call the Business Logic beans
> (not an option that I like), or is there a cleaner way to do this? I
> also have a similar issues with logging services.
> 
> I believe that a common way to solve this problem is to bind the
> DataSource to a jndi service. I am using tomcat 3.2.1, and I don't
> believe that this functionality is supplied in either Tomcat or
> Struts.
> 
> Thank You,
> Carles



Struts nightly build not working on Tomcat 4 nightly build

2001-03-13 Thread Richard Huss

Hi,

I'm trying to run struts-example.war (from the Struts nightly build) on the
latest Tomcat 4 nightly build; the relevant files I'm using are:

* jakarta-struts-20010312.zip
* jakarta-tomcat-4.0-20010312.zip

Tomcat 4 seems to be happy enough in its own way, but on deploying
struts-example.war and going to http://localhost:8080/struts-example/ I'm
getting the famous "javax.servlet.ServletException: Cannot find message
resources under key org.apache.struts.action.MESSAGE message" error.

Hmmm. Any thoughts? Not sure if it's a Tomcat or a Struts problem.

Richard Huss
Technical Architect, Wrox Press Ltd
[EMAIL PROTECTED]

www.wrox.com
p2p.wrox.com
www.wroxconferences.com
www.asptoday.com