Re: [s2] Do I still need a business service layer ?

2007-04-17 Thread nicolas de loof

I fully agree with those architecture consideration.

What I see in struts2 is that I can use my business service as MVC controler
with no dependency on the web framework. My business service only has to
switch from a stateless-style (method with parameters) to a statefull or
command-style (properties for input / output + execution method).

If I write my business layer this way, I don't consider it to become part of
the wab layer, but it can be used directly by strut2 as an "Action" by
simply setting the expected properties in the valueStack and executing the
business method.

Am I wrong ?

2007/4/18, Ray Clough <[EMAIL PROTECTED]>:



Architecture is architecture, regardless of whether it is Struts-1,
Struts-2,
or something else.  A Service Layer has the benefits of giving clear
separation of function between the Controller (Struts) and the
Application.
The web framework (here Struts) is primarily a vehicle for delivering data
back and forth between the Application and the user.  The application
should
be independent of the framework.  The Service Layer is really the API for
your application.  Without using a Service Layer, you tend to get lots of
Business Logic in the Action classes, which will tie your application not
only to the framework, but to the type of delivery platform (eg a Web
App),
which will prevent you from later making a Swing app or something else out
of it if you want to.

- Ray Clough



nicolas de loof-2 wrote:
>
> Hello,
>
> I've used struts1 for several years and I'm now looking at Struts².
>
> In struts1, to create a "registerUser" use-case I need a RegisterAction,
a
> RegistrationService and some business code.
> My struts1 RegistrationService is only used to start a transaction using
> Spring @Transactional annotation. Hibernate does all the required job.
>
> In struts2, AFAIK I can use any POJO as controler. Can I use my (maybe
> adapted) RegistrationService as a Controller by simply changing to a
> statefull model (user to register is not a method parameter anymore but
a
> bean property) ? This would make things really simplier !
>
> Nico.
>
>

--
View this message in context:
http://www.nabble.com/-s2--Do-I-still-need-a-business-service-layer---tf3591059.html#a10051941
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




[S2] How to have validation message using localization ?

2007-04-17 Thread MLENEVEUT
Hi all,

With Struts 2.0.6, I try to have validation message with localization.

For example, I have a "login" form, with a "loginInput" input text :




I have a validation on it :








And the "errors.required" is in my package.properties :
errors.required= The field "${getText(fieldName)}" is required !
login.login = Login

But this will displays : "The field "loginInput" is required !"

And I would like : "The field "Login" is required !". So I would like 
something which get the localization of my textfield label (login.login) 
to have localization in my error message, and not the field name, which 
does not say anything to the user :)

Could someone tells me how to do ?

Thanks a lot !

Regards,

Michaël.

Re: [OT] how to change the look and feel of checkbox

2007-04-17 Thread Pankaj Gupta

Yes I want to style the actual checkbox and not just the text.

regards,
Pankaj


On 4/11/07, James Mitchell <[EMAIL PROTECTED]> wrote:


Bolded text

Or, did you mean to style the actual checkbox?

--
James Mitchell



On Apr 11, 2007, at 4:37 AM, Pankaj Gupta wrote:

> Hi,
>
> I am using html:checkbox option to display a check box in disabled
> mode.
> This causes the checkbox to be greyed out. Can somebody please tell
> me how
> can I show it in bold font and disabled at the same time.
>
> regards,
> Pankaj


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Struts2 select tag multiple select

2007-04-17 Thread Stephanie

Thank you, that was it. I updated to 2.0.7 and it works now. I can't believe I 
didn't think to look through the Jira issues.

Thanks a bunch.

On Tue, 17 Apr 2007 14:41:11 + (UTC), Nate Drake <[EMAIL PROTECTED]> wrote:
> What version of Struts2 are you using?  There is a bug in versions before
> 2.0.7,
> where the select tag won't pre-select your values unless it is comparing
> Strings.
> 
> See this Jira issue for details:
> 
> https://issues.apache.org/struts/browse/WW-1711
> 
> 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 2 interceptors vs

2007-04-17 Thread Jason Wyatt
Hi,

I've written a simple PagingInterceptor in a Struts 2 project to do a
trivial calculation of the pageNumber used to display paged results, based
on whether the user pressed either a "Search", "Next Page" or "Previous
Page" submit button. 

I'm using the following interceptor stack:








The PagingInterceptor reads the "submit" parameter from the request,
increments or decrements the pageNumber, and stores pageNumber back in the
request. 

This works fine, however I also want to use the "method" param for the
 button like such:



I noticed when I add method="save" and hit the page with a browser, the
"submit" parameter seems to have been removed from the request *before* it
hits the top of the interceptor stack for the page, thus breaking my
PagingInterceptor.

Any ideas on why the submit parameter is removed, and how to fix this
problem - preferably via the Struts 2 framework?

Thanks in advance for any help, regards

Jason


 Itree Software www.itree.com.au
 Ph (02)42263454Fax (02)42263193
-> Meeting your requirements. 
-> Delivering on promises. 
-> Pride in our work.
 












-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] Do I still need a business service layer ?

2007-04-17 Thread Ray Clough

Architecture is architecture, regardless of whether it is Struts-1, Struts-2,
or something else.  A Service Layer has the benefits of giving clear
separation of function between the Controller (Struts) and the Application. 
The web framework (here Struts) is primarily a vehicle for delivering data
back and forth between the Application and the user.  The application should
be independent of the framework.  The Service Layer is really the API for
your application.  Without using a Service Layer, you tend to get lots of
Business Logic in the Action classes, which will tie your application not
only to the framework, but to the type of delivery platform (eg a Web App),
which will prevent you from later making a Swing app or something else out
of it if you want to.

- Ray Clough



nicolas de loof-2 wrote:
> 
> Hello,
> 
> I've used struts1 for several years and I'm now looking at Struts².
> 
> In struts1, to create a "registerUser" use-case I need a RegisterAction, a
> RegistrationService and some business code.
> My struts1 RegistrationService is only used to start a transaction using
> Spring @Transactional annotation. Hibernate does all the required job.
> 
> In struts2, AFAIK I can use any POJO as controler. Can I use my (maybe
> adapted) RegistrationService as a Controller by simply changing to a
> statefull model (user to register is not a method parameter anymore but a
> bean property) ? This would make things really simplier !
> 
> Nico.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-s2--Do-I-still-need-a-business-service-layer---tf3591059.html#a10051941
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSTL and the Value Stack

2007-04-17 Thread Dave Newton
--- Ray Clough <[EMAIL PROTECTED]> wrote:
> I'm using the S2 tags for the "NameValuePairs", and
> it works fine.  I'm trying to use JSTL for the
> "DataMatrices", and it doesn't work.

I'll examine this further when I get home.

> Of course, I REALLY don't want to implement
> ServletRequestAware, because I want to test my 
> Actions easily.

You don't need to; use RequestAware.

http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/interceptor/RequestAware.html

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts2, Tiles, Velocity

2007-04-17 Thread Charlie Rehor
I asked this on the velocity lists, and they punted to this list.

We're currently using Struts1.x, Velocity, and Tiles for our project,
which is working great.

However, we want to upgrade to Struts2, but Velocity Tools calls
Struts1.2 to handle calls to Tiles, which obviously breaks. 

So, the question is, can you use Struts2, Velocity, and Tiles together
right now? We've seen the examples for Struts2 and Velocity, but none
for the three components (Struts2, Velocity, and Tiles) put together. If
it exists, can you point me to documentation that describes
how to get a reference to Tiles from a Velocity file? For example, a
direct substitution for the Velocity Tools call:
$tiles.getAttribute("");


Thanks much,

Charlie Rehor


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSTL and the Value Stack

2007-04-17 Thread Ray Clough

The Exporter class is designed to make the data in my "Model" class available
for use in jsp.  It has a method "getDataMatrices()" and another
"getNameValuePairs()".  I'm using the S2 tags for the "NameValuePairs", and
it works fine.  I'm trying to use JSTL for the "DataMatrices", and it
doesn't work.

I've tried 2 methods of exposing the Exporter to the JSP:  (1) using a
method "getExporter()" in the Action, (2) having the Action implement
ServletRequestAware, and explicitly saving the Exporter into the Request. 
That is how I'd do in S1.

For either method, the S2 iterator tag works properly for the
"NameValuePairs" data.  However the JSTL tags display the "DataMatrices"
only If I put the Exporter into the HttpRequest.  The JSP page does not
change at all between the 2 methods.  Only the Action class changes.

Of course, I REALLY don't want to implement ServletRequestAware, because I
want to test my Actions easily.  Therefore I really need to make the
"getExporter()" method work with JSTL.

This page perfectly illustrates my point on the difficulty of the JSTL tags
working nicely with S2.  The page works perfectly if the object is
explicitly placed into the HttpRequest.  If the 'getExporter()' is the way
in which the Exporter is exposed, then it doesn't work for jstl.

- Ray Clough



Dave Newton-4 wrote:
> 
> --- Ray Clough <[EMAIL PROTECTED]> wrote:
>> My Action has a method "public Exporter
>> getExporter()".  If I use the struts2 
>> tags I can access the "exporter" with 
>> , 
>> and it works fine.  If I use the jstl syntax 
>> > var="matrix" >, nothing is found.  How do 
>> I get the jstl tag to work here? 
> 
> Without knowing what an Exporter is, I don't really
> know. 
> 
> You're using two different property names; did you
> mean to? 
> 
> Does Exporter follow JavaBean naming conventions for
> both of the properties you're accessing?
> 
> Use  but handle the inner loop with
> JSTL/JSP EL?
> 
> d.
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JSTL-and-the-Value-Stack-tf3595148.html#a10050445
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSTL and the Value Stack

2007-04-17 Thread Dave Newton
--- Ray Clough <[EMAIL PROTECTED]> wrote:
> My Action has a method "public Exporter
> getExporter()".  If I use the struts2 
> tags I can access the "exporter" with 
> , 
> and it works fine.  If I use the jstl syntax 
>  var="matrix" >, nothing is found.  How do 
> I get the jstl tag to work here? 

Without knowing what an Exporter is, I don't really
know. 

You're using two different property names; did you
mean to? 

Does Exporter follow JavaBean naming conventions for
both of the properties you're accessing?

Use  but handle the inner loop with
JSTL/JSP EL?

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Map-backed forms in Struts2

2007-04-17 Thread James Navin
Ok. I read the OGNL spec and it looks like the way of using maps etc. is
subtley different from Struts1. My JSP now looks like



and the associated Action class has methods

public void setAttribute(String key, Object value)
public Object getAttribute(String key)

The setAttribute method is still not being called (again, I have checked
with debug print statements), but this time in the catalina log I get the
following excepion messages along with a large stack trace

--snip--
Apr 18, 2007 9:57:01 AM
com.opensymphony.xwork2.util.InstantiatingNullHandler nullPropertyValue
SEVERE: Could not create and/or set value back on to object
ognl.NoSuchPropertyException:
com.csc.event.delivery.controller.EventOverviewController.attribute
[java.lang.IllegalAccessException: Class ognl.OgnlRuntime can not access a
member of class com.csc.event.delivery.controller.EventOverviewController
with modifiers "private"]
--snip--

It looks like it wants the actual attribute member to be public, but I
really dont want to do that...

Any help is much appreciated,

James

Lance <[EMAIL PROTECTED]> wrote on 17/04/2007 06:54:37 PM:

> Do you have a getValue(String key) method?
> I am not a s2 user but I have read the OGNL spec so sorry if I'm wrong
> but OGNL needs
>public PropertyType getPropertyName(IndexType index)
>and public void setPropertyName(IndexType index, PropertyType value)
>
> http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.
> html#N10189
>
> James Navin wrote:
> > Hi all,
> >
> > A system I am developing requires forms to be generated dynamically at
> > runtime based on data stored in a database. I have read that it is
possible
> > to use map-backed forms in Struts1 to achieve this using something of
the
> > form '' where the
> > associated Action class has a method of the form 'public void
> > setValue(String key, Object value)', resulting in name-value pairs
being
> > submitted to the Action class.
> >
> > Is this possible to achieve in Struts2? I have not been able to make it
> > work. When I use the above expression for the name attribute the
setValue
> > method is never called (I have checked this with a few debug print
> > statements), but no exception is thrown either. It just appears that
> > nothing happens.
> >
> > Is this something I am doing wrong, or is there some other way to do
this
> > in Struts2, or is it a bug?
> >
> > I am using Struts 2.0.6 with Java 1.5.3, Tomcat 5.5 and Internet
Explorer
> > 6.
> >
> > Thanks a lot in advance,
> >
> > James
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSTL and the Value Stack

2007-04-17 Thread Ray Clough

My Action has a method "public Exporter getExporter()".  If I use the struts2
tags I can access the "exporter" with , and it works fine.  If I use the jstl
syntax , nothing
is found.  How do I get the jstl tag to work here?  Thanks a million.

- Ray Clough



Musachy Barroso wrote:
> 
> http://cwiki.apache.org/confluence/display/WW/Can+we+use+JSTL+with+the+framework
> 
> I shouldn't be linking to the wiki but the main doc has an error (fixed on
> wiki already).
> 
> regards
> musachy
> 
> On 4/17/07, Ray Clough <[EMAIL PROTECTED]> wrote:
>>
>> Is it possible to use JSTL to access the value stack?   If so, what is
>> the syntax.  If that doesn't work, what is the syntax for accessing it
>> with a scriptlet?  That must be possible, because that is what the tags
>> do.
>>
>> Thanks very much,
>> Ray Clough
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JSTL-and-the-Value-Stack-tf3595148.html#a10050015
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 1.3.8: "Sidebar: Sharing JAR Files Across Web Applications"

2007-04-17 Thread Craig McClanahan

On 4/17/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Craig,

Craig McClanahan wrote:
> Craig McClanahan wrote:
> Yep ... it's magic :-).
>
> Actually, what happens is that the servlet container provides a
> mechanism to acquire the ClassLoader instance for the web application
> itself, from which you can load application classes no matter where
> the caller is located.  For instance, when Struts loads an action
> class, it does something like this (plus some exception catching, of
> course):
>
>String actionClassName = ...;
>ClassLoader cl = Thread.currentThread().getContextClassLoader();
>Class actionClass = cl.loadClass(actionClassName);

I thought that the server created and started those threads
independently of the webapp being used.


Yes, it does ... although there is no restriction that a particular
thread be used *only* for a particular application.  Generally, the
server will pool the threads across all active apps.


I've never used
Thread.getContextClassLoader... is that something that the server sets
when it handles a request -- for purposes such as this?


Yes, that's exactly what it is for.

Craig



> The container guarantees that the context class loader for a thread is
> set correctly, before it enters your servlet, filter, or listener.

I guess so... ;)

> There is indeed no way to search down the hierarchy, which is why the
> context class loader convention was created.  As you examine libraries
> for potentially putting them into a shared class loader, look for code
> that does this kind of thing.

Cool. Thanks for the explanation, Craig.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJS4d9CaO5/Lv0PARAqzKAKC4t0HR31h8KaLX471socJ7rbNphQCfWpAM
IrvvDVTjDYBpzob6TtwoGl4=
=Qq2L
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Interceptors and thread-safety

2007-04-17 Thread Dale Newfield
Now I'm even more confused about where dependency injection happens for 
interceptors.


My long running process is importing large numbers of documents into my 
system (extracted from an uploaded .zip file), which needs DB access 
throughout the process.  As such, I use something based upon:


http://struts.apache.org/2.x/docs/hibernateandspringenabledexecuteandwaitinterceptor.html
(My thanks to bigfleet, the original author of this document!)

And it's only sometimes working, as it seems that I only sometimes have 
a non-null sessionFactory available (patterns for when are not yet 
apparent)...


The life-cycle of the interceptor is unclear to me, as is what would 
call the setSessionFactory method.  Previous comments in this thread 
indicated that each configured interceptor stack results in a single 
instance of the interceptor upon webapp startup?  Am I stating that 
correctly?  If so, I don't understand how that single object have had 
it's sessionFactory dependency injected sometimes but not others...


I don't think I have any configuration anywhere telling spring to inject 
the sessionFactory, but it is sometimes getting injected anyway. 
Probably all I need to do is figure out where this magic is happening, 
and specify it explicitly to avoid the reliance on such magic...can 
anyone fill me in on where to look?


-Dale

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does anyone know how to use Restful2ActionMapper??

2007-04-17 Thread Drew Kutcharian
Thanks Dave, I have read that. What I am trying to accomplish is to have URLs 
like the following and I dont know how exactly I can pull it off using Struts 2.
The page that you have linked contains a Rails link 
http://ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-it
 and in that page there are a lot of advanced things you can do with Rails 
routes.
In particular what I'm trying to do is to support URLs such as:

GET: /users => [:action => 'index']
GET: /users.xml => [:action => 'index', :format => 'xml']
GET: /users/1 => [:action => 'show', :id => 1]
GET: /users/1;edit => [:action => 'edit', :id => 1]
GET: /users/1.xml => [:action => 'show', :id => 1, :format => 'xml']

POST: /users => [:action => 'create']
PUT: /users/1 => [:action => 'update', :id => 1]
DELETE: /users/1 => [:action => 'destroy', :id => 1]also be able to do things 
like:

GET /category/managers/users  (which returns all the users under category 
'managers')
GET /category/managers/users.xml  (...in xml format)
 
and I am also not sure how all this is going to work with Struts2 (webwork) 
namespaces.


Thanks,


Drew Kutcharian
Venarc Inc.   www.venarc.com


- Original Message 
From: Dave Newton <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Tuesday, April 17, 2007 1:44:05 PM
Subject: Re: Does anyone know how to use Restful2ActionMapper??

--- Drew Kutcharian <[EMAIL PROTECTED]> wrote:
> Can anyone explain to me how I can use the new
> Restful2ActionMapper? I was not able to find
> detailed documentation on it anywhere on the web.
> I am trying to write a Rails style RESTful app in
> Java.

For now, at least, I'd look at the original

http://struts.apache.org/2.x/docs/restfulactionmapper.html

and the API doc for Restful2.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








Re: Does anyone know how to use Restful2ActionMapper??

2007-04-17 Thread Dave Newton
--- Drew Kutcharian <[EMAIL PROTECTED]> wrote:
> Can anyone explain to me how I can use the new
> Restful2ActionMapper? I was not able to find
> detailed documentation on it anywhere on the web.
> I am trying to write a Rails style RESTful app in
> Java.

For now, at least, I'd look at the original

http://struts.apache.org/2.x/docs/restfulactionmapper.html

and the API doc for Restful2.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts 2.0.7 template/simple/select.ftl error/fix

2007-04-17 Thread Jason Thurston

I'm not yet setup subversion so I did not create a patch.  I did just report
the issue to  JIRA, issue number (WW-1887)

On 4/17/07, Martin Gainty <[EMAIL PROTECTED]> wrote:


Jason

Thanks for the fix
Did you commit the patch?

Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please
notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message -
From: "Jason Thurston" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, April 17, 2007 3:56 PM
Subject: struts 2.0.7 template/simple/select.ftl error/fix


> To fix I extracted template/simple/select.ftl from the
> struts2-core-2.0.7.jar to WEB-INF/classes/template/simple/select.ftl
>
> I then
> changed line 60 from:
>
> to:
> 
>
> and I inserted the following line before line 60:
> <#assign itemKeyStr=itemKey.toString() />
>
> I got the idea from another .ftl file that does something similar.
>
>
> The error message this fixed was:
>
> Error on line 60, column 22 in template/simple/select.ftl
> Expecting a string, date or number here, Expression itemKey is instead a
> freemarker.ext.beans.BooleanModel
> The problematic instruction:
>
> --
> ==> ${itemKey?html} [on line 60, column 20 in
template/simple/select.ftl]
> in user-directive s.iterator [on line 41, column 1 in
> template/simple/select.ftl]
> --
> Java backtrace for programmers:
> --
> freemarker.core.NonStringException: Error on line 60, column 22 in
> template/simple/select.ftl
> Expecting a string, date or number here, Expression itemKey is instead a
> freemarker.ext.beans.BooleanModel
>
>
>
>
>
>
> -Jason
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Jason Thurston


Does anyone know how to use Restful2ActionMapper??

2007-04-17 Thread Drew Kutcharian
Hi Everyone,

Can anyone explain to me how I can use the new Restful2ActionMapper? I was not 
able to find detailed documentation on it anywhere on the web.
I am trying to write a Rails style RESTful app in Java.

Thanks,
 
Drew Kutcharian
Venarc Inc.   www.venarc.com



Re: Struts 1.3.8: "Sidebar: Sharing JAR Files Across Web Applications"

2007-04-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Craig,

Craig McClanahan wrote:
> Craig McClanahan wrote:
> Yep ... it's magic :-).
> 
> Actually, what happens is that the servlet container provides a
> mechanism to acquire the ClassLoader instance for the web application
> itself, from which you can load application classes no matter where
> the caller is located.  For instance, when Struts loads an action
> class, it does something like this (plus some exception catching, of
> course):
> 
>String actionClassName = ...;
>ClassLoader cl = Thread.currentThread().getContextClassLoader();
>Class actionClass = cl.loadClass(actionClassName);

I thought that the server created and started those threads
independently of the webapp being used. I've never used
Thread.getContextClassLoader... is that something that the server sets
when it handles a request -- for purposes such as this?

> The container guarantees that the context class loader for a thread is
> set correctly, before it enters your servlet, filter, or listener.

I guess so... ;)

> There is indeed no way to search down the hierarchy, which is why the
> context class loader convention was created.  As you examine libraries
> for potentially putting them into a shared class loader, look for code
> that does this kind of thing.

Cool. Thanks for the explanation, Craig.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJS4d9CaO5/Lv0PARAqzKAKC4t0HR31h8KaLX471socJ7rbNphQCfWpAM
IrvvDVTjDYBpzob6TtwoGl4=
=Qq2L
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts 2.0.7 template/simple/select.ftl error/fix

2007-04-17 Thread Martin Gainty

Jason

Thanks for the fix
Did you commit the patch?

Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Jason Thurston" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, April 17, 2007 3:56 PM
Subject: struts 2.0.7 template/simple/select.ftl error/fix



To fix I extracted template/simple/select.ftl from the
struts2-core-2.0.7.jar to WEB-INF/classes/template/simple/select.ftl

I then
changed line 60 from:
   
to:


and I inserted the following line before line 60:
<#assign itemKeyStr=itemKey.toString() />

I got the idea from another .ftl file that does something similar.


The error message this fixed was:

Error on line 60, column 22 in template/simple/select.ftl
Expecting a string, date or number here, Expression itemKey is instead a
freemarker.ext.beans.BooleanModel
The problematic instruction:

--
==> ${itemKey?html} [on line 60, column 20 in template/simple/select.ftl]
in user-directive s.iterator [on line 41, column 1 in
template/simple/select.ftl]
--
Java backtrace for programmers:
--
freemarker.core.NonStringException: Error on line 60, column 22 in
template/simple/select.ftl
Expecting a string, date or number here, Expression itemKey is instead a
freemarker.ext.beans.BooleanModel






-Jason



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] Do I still need a business service layer ?

2007-04-17 Thread Mark Menard
On 4/17/07 10:20 AM, "nicolas de loof" <[EMAIL PROTECTED]> wrote:

> In struts2, AFAIK I can use any POJO as controler. Can I use my (maybe
> adapted) RegistrationService as a Controller by simply changing to a
> statefull model (user to register is not a method parameter anymore but a
> bean property) ? This would make things really simplier !

Hi Nico,

I guess you could do that, but I don't think I'd recommend it. It mixes up
control (your action) with business services (your service bean). Personally
I would keep them separate, and let each do what it is best at.

Mark

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Interceptors and thread-safety

2007-04-17 Thread Mark Menard
On 4/17/07 5:38 AM, "Dave Newton" <[EMAIL PROTECTED]> wrote:

> --- Dale Newfield <[EMAIL PROTECTED]> wrote:
>> [...] so that implies only a single simultaneous use
> 
>> of a single execAndWait action per login?
> 
>> From the execAndWait JavaDoc:
> 
> """
> This interceptor works on a per-session basis. That
> means that the same action name (myLongRunningAction,
> in the above example) cannot be run more than once at
> a time in a given session.
> """

Could this be wrapped in a conversation? I haven't looked at the interceptor
so I don't know how hard it would be.

Mark

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSTL versus Struts tags

2007-04-17 Thread Dave Newton
--- Heidy Gutiérrez Guzmán <[EMAIL PROTECTED]>
wrote:
> Where do I find information about the diffrence
> between JSTL and struts tags?

I'm not sure what kind(s) of differences you're
looking for, but assuming you already know JSTL tags
I'd start by looking at the documentation for the S2
tags, starting at:

http://struts.apache.org/2.x/docs/tag-developers-guide.html

(I personally find the tag documentation a little
twisted to navigate so far.)

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: newbie alert: forward to a php script

2007-04-17 Thread Laurie Harper
I'm still not clear why you need the PHP script at all; why not call out 
to the remote server directly from your Java webapp? That would seem to 
be a simpler route.


However, if you really do need the PHP script in there something like 
HttpClient, as suggested by another poster, would probably be the 
easiest way to build and submit the HTTP request.


L.

Chris Pat wrote:

Hi Laurie
Thanks.  All I need is to send a HTTP Post request to  the php script with the 
parameters that the Action received, but having done some processing in the 
Action.  At this point I dont care if the client sees the results of the php 
output.  I dont see how to generate something like a RequestDisptacher from 
within an Action even if I just send the client to a success page at the end.

My design problem is that I am trying to talk to a cc processor using struts 
code.  Right now the only way I can send the post to the cc processor and 
receive the response on the same port is with a php script.  So I thought of 
splitting it up and using curl to send to the cc processor after processing it 
in an Action, receiving it in the php scrip and forwarding it to another Action 
for post processing.  I have to get around the fact that the cc processor will 
only send back a response on the same port that the port as the request, 
obviously without a nicely formatted context/servlet syntax.  I believe this 
will work, if I can only get a post sent to the php script which will be a url 
outside of the Struts framework.  I am sure this massively violative MVC and 
probably not scalable, but I just have to get it done.  Thanks for even the 
slightest insight, even if saying it is utterly stup
 id, grin.

Laurie Harper <[EMAIL PROTECTED]> wrote: Chris Pat wrote:

Hello
Is it possible to have an Action that processes some data and then posts to a 
url completely out of control of the framework?  I want to process and write to 
a db first and then using the same parameters and any added session variables 
post to a php script, initially running on localhost but eventually on a 
completely different url.  Can someone help me understand how or why not.  I 
really need to do it even if it is not to the spec.  Thank you.


Post to? Sure, you can create an HTTP POST request to any URL. But I 
suspect that's not quite what you mean. If you mean /forward/ to, as in 
dispatch to, a PHP script, it's not so straight forward.


I seem to recall seeing mention on this list in the past of some sort of 
Java-PHP bridge, which may be what you're looking for. Search the 
archives (or Google) for 'Java PHP bridge' and see if that turns 
anything useful up. Alternatively, re-post with clarification of exactly 
what you want to achieve; maybe someone will be able to give a more 
specific solution.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FW: Tiles refresh

2007-04-17 Thread Hehl, Thomas
 

 

  _  

From: Hehl, Thomas 
Sent: Tuesday, April 17, 2007 4:00 PM
To: '[EMAIL PROTECTED]'
Subject: Tiles refresh

 

I have a tile screen that is set up roughly thus:

 


 

A


B

C

 


 

 

 

 

 

When the user clicks a button, I change the value in C, but sometimes I want
to refresh B as well since it needs to re-run code to pick up the current
state. I can't figure out how to do this for the specific screens of C that
I want. Does anyone have a solution to this?

 



JSTL versus Struts tags

2007-04-17 Thread Heidy Gutiérrez Guzmán

Where do I find information about the diffrence between JSTL and struts
tags?


struts 2.0.7 template/simple/select.ftl error/fix

2007-04-17 Thread Jason Thurston

To fix I extracted template/simple/select.ftl from the
struts2-core-2.0.7.jar to WEB-INF/classes/template/simple/select.ftl

I then
changed line 60 from:
   
to:


and I inserted the following line before line 60:
<#assign itemKeyStr=itemKey.toString() />

I got the idea from another .ftl file that does something similar.


The error message this fixed was:

Error on line 60, column 22 in template/simple/select.ftl
Expecting a string, date or number here, Expression itemKey is instead a
freemarker.ext.beans.BooleanModel
The problematic instruction:

--
==> ${itemKey?html} [on line 60, column 20 in template/simple/select.ftl]
in user-directive s.iterator [on line 41, column 1 in
template/simple/select.ftl]
--
Java backtrace for programmers:
--
freemarker.core.NonStringException: Error on line 60, column 22 in
template/simple/select.ftl
Expecting a string, date or number here, Expression itemKey is instead a
freemarker.ext.beans.BooleanModel






-Jason


Re: JSTL and the Value Stack

2007-04-17 Thread Musachy Barroso

In  ${expression}, "expression" will be evaluated against the Value Stack.
An Dave is right, the "variable publishing" name is probably not the best
description for it :)

musachy

On 4/17/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:


The do publish a variable, if they have to, as Dave mentioned, in the case
of the iterator, even if you don't specify and id, the current value will be
on top of the stack which you access using %{#top}. Other tags publish
values, like the url tag, etc.

musachy

On 4/17/07, Dave Newton <[EMAIL PROTECTED]> wrote:
>
> --- Ray Clough <[EMAIL PROTECTED]> wrote:
> > The "why" is because I just really don't like the
> > Struts-2 tags.  I especially don't like the fact
> that
> > they don't expose a variable on the page - for
> > example the s:iterator tag does not explicitly
> expose
> > a variable which I can work with, or format using
> > jstl.
>
> ...but I'm telling you they do, or at least
>  does.
>
> 
>   
>   
> 
>
> d.
>
>
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"Hey you! Would you help me to carry the stone?" Pink Floyd





--
"Hey you! Would you help me to carry the stone?" Pink Floyd


Re: JSTL and the Value Stack

2007-04-17 Thread Musachy Barroso

The do publish a variable, if they have to, as Dave mentioned, in the case
of the iterator, even if you don't specify and id, the current value will be
on top of the stack which you access using %{#top}. Other tags publish
values, like the url tag, etc.

musachy

On 4/17/07, Dave Newton <[EMAIL PROTECTED]> wrote:


--- Ray Clough <[EMAIL PROTECTED]> wrote:
> The "why" is because I just really don't like the
> Struts-2 tags.  I especially don't like the fact
that
> they don't expose a variable on the page - for
> example the s:iterator tag does not explicitly
expose
> a variable which I can work with, or format using
> jstl.

...but I'm telling you they do, or at least
 does.


  
  


d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
"Hey you! Would you help me to carry the stone?" Pink Floyd


Re: JSTL and the Value Stack

2007-04-17 Thread Dave Newton
--- Dave Newton <[EMAIL PROTECTED]> wrote:
> ...but I'm telling you they do [expose variables to 
> JSTL], or at least  does.

Let me re-phrase that... it's not so much that they
"expose" variables, but that the StrutsRequestWrappers
will pass variable requests (not sure what to call
this, somebody hep me, hep me) to the OGNL stack.

My terminology is undoubtedly wrong, but the previous
JSP fragment was right :)

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSTL and the Value Stack

2007-04-17 Thread Dave Newton
--- Ray Clough <[EMAIL PROTECTED]> wrote:
> The "why" is because I just really don't like the
> Struts-2 tags.  I especially don't like the fact
that
> they don't expose a variable on the page - for 
> example the s:iterator tag does not explicitly
expose
> a variable which I can work with, or format using
> jstl.  

...but I'm telling you they do, or at least
 does.


  
  


d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: newbie alert: forward to a php script

2007-04-17 Thread Chris Pat
Hi IG
That looks like the object.  Thanks.

Information Guzzler <[EMAIL PROTECTED]> wrote: Hi Chris,

HttpClient would be an alternative to generate HTTP POST request. For info.
refer

http://jakarta.apache.org/commons/httpclient/

/I

On 4/17/07, Chris Pat  wrote:
>
> Hello
> Sorry for the persistence/naivete of this, however can someone tell me if
> this is possible and how?  It will be a learning experience for me and I
> appreciate any insight.
>
> Chris Pat  wrote: Hi Laurie
> Thanks.  All I need is to send a HTTP Post request to  the php script with
> the parameters that the Action received, but having done some processing in
> the Action.  At this point I dont care if the client sees the results of the
> php output.  I dont see how to generate something like a RequestDisptacher
> from within an Action even if I just send the client to a success page at
> the end.
>
> My design problem is that I am trying to talk to a cc processor using
> struts code.  Right now the only way I can send the post to the cc processor
> and receive the response on the same port is with a php script.  So I
> thought of splitting it up and using curl to send to the cc processor after
> processing it in an Action, receiving it in the php scrip and forwarding it
> to another Action for post processing.  I have to get around the fact that
> the cc processor will only send back a response on the same port that the
> port as the request, obviously without a nicely formatted context/servlet
> syntax.  I believe this will work, if I can only get a post sent to the php
> script which will be a url outside of the Struts framework.  I am sure this
> massively violative MVC and probably not scalable, but I just have to get it
> done.  Thanks for even the slightest insight, even if saying it is utterly
> stupid, grin.
>
> Laurie Harper  wrote: Chris Pat wrote:
> > Hello
> > Is it possible to have an Action that processes some data and then posts
> to a url completely out of control of the framework?  I want to process and
> write to a db first and then using the same parameters and any added session
> variables post to a php script, initially running on localhost but
> eventually on a completely different url.  Can someone help me understand
> how or why not.  I really need to do it even if it is not to the
> spec.  Thank you.
>
> Post to? Sure, you can create an HTTP POST request to any URL. But I
> suspect that's not quite what you mean. If you mean /forward/ to, as in
> dispatch to, a PHP script, it's not so straight forward.
>
> I seem to recall seeing mention on this list in the past of some sort of
> Java-PHP bridge, which may be what you're looking for. Search the
> archives (or Google) for 'Java PHP bridge' and see if that turns
> anything useful up. Alternatively, re-post with clarification of exactly
> what you want to achieve; maybe someone will be able to give a more
> specific solution.
>
> L.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>



Re: JSTL and the Value Stack

2007-04-17 Thread Ray Clough
The "why" is because I just really don't like the Struts-2 tags.  I 
especially don't like the fact that they don't expose a variable on the 
page - for example the s:iterator tag does not explicitly expose a 
variable which I can work with, or format using jstl.  They "don't play 
nicely with the other children", as my grade school teacher once 
reported.  Maybe I'm wrong, but that is my experience so far.


- Ray Clough


Dave Newton wrote:

--- Ray Clough <[EMAIL PROTECTED]> wrote:
  

Is it possible to use JSTL to access the value

stack?  


The StrutsRequestWrapper (?) will forward...
"unfulfilled" attribute requests to the OGNL stack. I
wouldn't be sure of the exact syntax; it may depend on
what, exactly, you're trying to access (and why?)

For instance, you can access Action properties via JSP
EL, the scoped attributes (obviously), etc.

  
If that doesn't work, what is the syntax for 
accessing it with a scriptlet?



Now you're just scaring me.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: newbie alert: forward to a php script

2007-04-17 Thread Information Guzzler

Hi Chris,

HttpClient would be an alternative to generate HTTP POST request. For info.
refer

http://jakarta.apache.org/commons/httpclient/

/I

On 4/17/07, Chris Pat <[EMAIL PROTECTED]> wrote:


Hello
Sorry for the persistence/naivete of this, however can someone tell me if
this is possible and how?  It will be a learning experience for me and I
appreciate any insight.

Chris Pat <[EMAIL PROTECTED]> wrote: Hi Laurie
Thanks.  All I need is to send a HTTP Post request to  the php script with
the parameters that the Action received, but having done some processing in
the Action.  At this point I dont care if the client sees the results of the
php output.  I dont see how to generate something like a RequestDisptacher
from within an Action even if I just send the client to a success page at
the end.

My design problem is that I am trying to talk to a cc processor using
struts code.  Right now the only way I can send the post to the cc processor
and receive the response on the same port is with a php script.  So I
thought of splitting it up and using curl to send to the cc processor after
processing it in an Action, receiving it in the php scrip and forwarding it
to another Action for post processing.  I have to get around the fact that
the cc processor will only send back a response on the same port that the
port as the request, obviously without a nicely formatted context/servlet
syntax.  I believe this will work, if I can only get a post sent to the php
script which will be a url outside of the Struts framework.  I am sure this
massively violative MVC and probably not scalable, but I just have to get it
done.  Thanks for even the slightest insight, even if saying it is utterly
stupid, grin.

Laurie Harper  wrote: Chris Pat wrote:
> Hello
> Is it possible to have an Action that processes some data and then posts
to a url completely out of control of the framework?  I want to process and
write to a db first and then using the same parameters and any added session
variables post to a php script, initially running on localhost but
eventually on a completely different url.  Can someone help me understand
how or why not.  I really need to do it even if it is not to the
spec.  Thank you.

Post to? Sure, you can create an HTTP POST request to any URL. But I
suspect that's not quite what you mean. If you mean /forward/ to, as in
dispatch to, a PHP script, it's not so straight forward.

I seem to recall seeing mention on this list in the past of some sort of
Java-PHP bridge, which may be what you're looking for. Search the
archives (or Google) for 'Java PHP bridge' and see if that turns
anything useful up. Alternatively, re-post with clarification of exactly
what you want to achieve; maybe someone will be able to give a more
specific solution.

L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






Re: JSTL and the Value Stack

2007-04-17 Thread Dave Newton
--- Ray Clough <[EMAIL PROTECTED]> wrote:
> Is it possible to use JSTL to access the value
stack?  

The StrutsRequestWrapper (?) will forward...
"unfulfilled" attribute requests to the OGNL stack. I
wouldn't be sure of the exact syntax; it may depend on
what, exactly, you're trying to access (and why?)

For instance, you can access Action properties via JSP
EL, the scoped attributes (obviously), etc.

> If that doesn't work, what is the syntax for 
> accessing it with a scriptlet?

Now you're just scaring me.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSTL and the Value Stack

2007-04-17 Thread Musachy Barroso

http://cwiki.apache.org/confluence/display/WW/Can+we+use+JSTL+with+the+framework

I shouldn't be linking to the wiki but the main doc has an error (fixed on
wiki already).

regards
musachy

On 4/17/07, Ray Clough <[EMAIL PROTECTED]> wrote:


Is it possible to use JSTL to access the value stack?   If so, what is
the syntax.  If that doesn't work, what is the syntax for accessing it
with a scriptlet?  That must be possible, because that is what the tags
do.

Thanks very much,
Ray Clough


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
"Hey you! Would you help me to carry the stone?" Pink Floyd


RE: Struts in Servlet 2.4

2007-04-17 Thread Dave Newton
I don't know what, if anything, WL provides; you may
still need the jstl/standard libs, just a later
version.

--- "Slattery, Tim - BLS" <[EMAIL PROTECTED]>
wrote:

>  
> > > <%@ taglib uri="http://java.sun.com/jstl/core";
> > > prefix="c" %>
> > > <%@ taglib uri="http://java.sun.com/jstl/fmt";
> > > prefix="fmt" %>
> > > 
> > > I get this message for both tags:
> > > 
> > > No tag library could be found with this URI.
> > > Possible causes could be
> > > that the URI is incorrect, or that there were
> errors during 
> > parsing of 
> > > the .tld file.
> > 
> > I think the URI is now
> {http...}/jsp/jstl/{whichever}.
> 
> I've tried it that way too:
> 
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core";
> prefix="c" %>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt";
> prefix="fmt" %>
> 
> Same messages.
> 
> 
> --
> Tim Slattery
> [EMAIL PROTECTED]
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JSTL and the Value Stack

2007-04-17 Thread Ray Clough
Is it possible to use JSTL to access the value stack?   If so, what is 
the syntax.  If that doesn't work, what is the syntax for accessing it 
with a scriptlet?  That must be possible, because that is what the tags do.


Thanks very much,
Ray Clough


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 1.3.8: "Sidebar: Sharing JAR Files Across Web Applications"

2007-04-17 Thread Craig McClanahan

On 4/17/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Craig,

Craig McClanahan wrote:
> The naive way for a library to do this is:
>
>String className = ...; // Calculate the name of the class you want
>Class clazz = Class.forName(className);
>
> * If commons-foo.jar is stored in a shared classloader provided by your
>  container, you'll get a ClassNotFoundException.  That happens because
>  Class.forName() and friends start from the classloader that loaded the
>  calling class itself (i.e. the commons-foo class doing this work) ... but
>  your application class is not visible because you can only look *up* a
>  classloader hierarchy, not down.

Can you briefly explain how struts even works when loaded from a shared
ClassLoader? My reading of this suggests that shared struts would not be
able to load actions found in the webapp's ClassLoader(s), but it sounds
like the OP has done this successfully.



Yep ... it's magic :-).

Actually, what happens is that the servlet container provides a
mechanism to acquire the ClassLoader instance for the web application
itself, from which you can load application classes no matter where
the caller is located.  For instance, when Struts loads an action
class, it does something like this (plus some exception catching, of
course):

   String actionClassName = ...;
   ClassLoader cl = Thread.currentThread().getContextClassLoader();
   Class actionClass = cl.loadClass(actionClassName);

The container guarantees that the context class loader for a thread is
set correctly, before it enters your servlet, filter, or listener.


I'm just curious how it is done because you say above that this is a
naive implementation... how does one do this in a smart way? It's not
too relevant to the question... just thought I'd take the opportunity to
find out since I've never heard of a good way to search "down" the
ClassLoader hierarchy.



There is indeed no way to search down the hierarchy, which is why the
context class loader convention was created.  As you examine libraries
for potentially putting them into a shared class loader, look for code
that does this kind of thing.


Thanks,
- -chris



Craig



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJMBM9CaO5/Lv0PARAqcPAJ9vnk8pj9El1gWtmqPv2smLYkSyxgCbBjOx
1nEpmu62YlqqDaqjHYLEkN8=
=HxZg
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 + FCKeditor

2007-04-17 Thread Andrew Stepanenko

Hello,

we integrated FCKeditor with Struts 2.0.3 trunk I think. It was done
the same way it is done in webwork 2.2.4
(http://opensymphony.com/webwork/). I just copied necessary files from
Webwork source and renamed imports. You'll need to rebuild your struts
jars.

Regards,
Andrew Stepanenko

On 4/17/07, Monttez <[EMAIL PROTECTED]> wrote:

Has anyone integrated FCKeditor with Struts2 ?

Can you point me the way ?


Thanks!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Change the searchLimit for the autocompleter?

2007-04-17 Thread Musachy Barroso

it would be easier just to wait for 2.0.8, which will probably happen this
week or next, Ted can confirm on that. If you want to hack around Dojo, you
can set it with something like

dojo.widget.byId("autocompleter_Id_here").dataProvider.searchLimit = 100;

regards
musachy

On 4/17/07, Adam Ruggles <[EMAIL PROTECTED]> wrote:


Would you happen to know which attribute in dojo needs to be set or do I
need to wait for a newer version to be release with struts?

Musachy Barroso wrote:
> I didn't even know there was a limit until I saw it the other day on
> Dojo's
> code. Just adding an attribute is easy, so it can be tackled for 2.0.8:
>
> https://issues.apache.org/struts/browse/WW-1886
>
> musachy
>
> On 4/16/07, Adam Ruggles <[EMAIL PROTECTED]> wrote:
>>
>> Is there a way to change the default searchLimit on the autocompleter
>> tag?  I guess the default is 30 but I need that increased.
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
"Hey you! Would you help me to carry the stone?" Pink Floyd


RE: Struts in Servlet 2.4

2007-04-17 Thread Slattery, Tim - BLS
 
> > <%@ taglib uri="http://java.sun.com/jstl/core";
> > prefix="c" %>
> > <%@ taglib uri="http://java.sun.com/jstl/fmt";
> > prefix="fmt" %>
> > 
> > I get this message for both tags:
> > 
> > No tag library could be found with this URI.
> > Possible causes could be
> > that the URI is incorrect, or that there were errors during 
> parsing of 
> > the .tld file.
> 
> I think the URI is now {http...}/jsp/jstl/{whichever}.

I've tried it that way too:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>

Same messages.


--
Tim Slattery
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Change the searchLimit for the autocompleter?

2007-04-17 Thread Adam Ruggles
Would you happen to know which attribute in dojo needs to be set or do I 
need to wait for a newer version to be release with struts?


Musachy Barroso wrote:
I didn't even know there was a limit until I saw it the other day on 
Dojo's

code. Just adding an attribute is easy, so it can be tackled for 2.0.8:

https://issues.apache.org/struts/browse/WW-1886

musachy

On 4/16/07, Adam Ruggles <[EMAIL PROTECTED]> wrote:


Is there a way to change the default searchLimit on the autocompleter
tag?  I guess the default is 30 but I need that increased.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Velocity in Struts2

2007-04-17 Thread Michael

The problem was in my spring config. I was proxying the Action with the
TransactionProxyFactoryBean. When that was removed (juggling the Hibernate
Session management somewhere else) the Action was correctly set into the
Velocity context.

Thanks for the prompt reply, it forced to me to review my setup (which I
should have done in the first place)
--Michael

On 4/17/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:


I'm not sure what the problem is, but adding $action to example.vm in
showcase, I see that it prints "
[EMAIL PROTECTED]" on the page, so the
reference is there. Can you post more details, like the mapping for your
action, the package declaration, etc?

regards
musachy

On 4/17/07, Michael <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have scratched my head and googled this for hours to no avail, so
maybe
> you folks can give me a hand.
>
> I am trying to migrate a Struts1 site to Struts2 (from maven,
struts-core
> 2.0.6).  So far everything is fine, except for Velocity (verison 1.4).
The
> Action is being called and returning successfully, the correct Velocity
> template is being loaded and parsed, but the Action is no where to be
> found
> for the Velocity template. In http://cwiki.apache.org/WW/velocity.htmlit
> states that the Action's properties will be present for the template
> context, along with other help variables (i.e. $stack, $action, etc ).
My
> Velocity template has nothing, just $struts.valueStack in the request
> attributes.
>
> Seems like there is a final step missing that processes the Action into
> the
> Velocity context?
>
> The entire site is already using Velocity, so migrating to Freemaker is
> not
> really an option at this time.
>
>
> thanks,
> Michael
>



--
"Hey you! Would you help me to carry the stone?" Pink Floyd



Struts2 + FCKeditor

2007-04-17 Thread Monttez
Has anyone integrated FCKeditor with Struts2 ?

Can you point me the way ?


Thanks!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts in Servlet 2.4

2007-04-17 Thread Dave Newton
--- "Slattery, Tim - BLS" <[EMAIL PROTECTED]>
wrote:
> I switched that directive to <% page session="true"
> %>, and it finds Contact in Session context!

Zounds.

> <%@ taglib uri="http://java.sun.com/jstl/core";
> prefix="c" %>
> <%@ taglib uri="http://java.sun.com/jstl/fmt";
> prefix="fmt" %>
> 
> I get this message for both tags:
> 
> No tag library could be found with this URI.
> Possible causes could be 
> that the URI is incorrect, or that there were errors
> during parsing of
> the .tld file.

I think the URI is now {http...}/jsp/jstl/{whichever}.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: newbie alert: forward to a php script

2007-04-17 Thread Chris Pat
Hello
Sorry for the persistence/naivete of this, however can someone tell me if this 
is possible and how?  It will be a learning experience for me and I appreciate 
any insight.  

Chris Pat <[EMAIL PROTECTED]> wrote: Hi Laurie
Thanks.  All I need is to send a HTTP Post request to  the php script with the 
parameters that the Action received, but having done some processing in the 
Action.  At this point I dont care if the client sees the results of the php 
output.  I dont see how to generate something like a RequestDisptacher from 
within an Action even if I just send the client to a success page at the end.

My design problem is that I am trying to talk to a cc processor using struts 
code.  Right now the only way I can send the post to the cc processor and 
receive the response on the same port is with a php script.  So I thought of 
splitting it up and using curl to send to the cc processor after processing it 
in an Action, receiving it in the php scrip and forwarding it to another Action 
for post processing.  I have to get around the fact that the cc processor will 
only send back a response on the same port that the port as the request, 
obviously without a nicely formatted context/servlet syntax.  I believe this 
will work, if I can only get a post sent to the php script which will be a url 
outside of the Struts framework.  I am sure this massively violative MVC and 
probably not scalable, but I just have to get it done.  Thanks for even the 
slightest insight, even if saying it is utterly stupid, grin.

Laurie Harper  wrote: Chris Pat wrote:
> Hello
> Is it possible to have an Action that processes some data and then posts to a 
> url completely out of control of the framework?  I want to process and write 
> to a db first and then using the same parameters and any added session 
> variables post to a php script, initially running on localhost but eventually 
> on a completely different url.  Can someone help me understand how or why 
> not.  I really need to do it even if it is not to the spec.  Thank you.

Post to? Sure, you can create an HTTP POST request to any URL. But I 
suspect that's not quite what you mean. If you mean /forward/ to, as in 
dispatch to, a PHP script, it's not so straight forward.

I seem to recall seeing mention on this list in the past of some sort of 
Java-PHP bridge, which may be what you're looking for. Search the 
archives (or Google) for 'Java PHP bridge' and see if that turns 
anything useful up. Alternatively, re-post with clarification of exactly 
what you want to achieve; maybe someone will be able to give a more 
specific solution.

L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Re: Velocity in Struts2

2007-04-17 Thread Musachy Barroso

I'm not sure what the problem is, but adding $action to example.vm in
showcase, I see that it prints "
[EMAIL PROTECTED]" on the page, so the
reference is there. Can you post more details, like the mapping for your
action, the package declaration, etc?

regards
musachy

On 4/17/07, Michael <[EMAIL PROTECTED]> wrote:


Hello,

I have scratched my head and googled this for hours to no avail, so maybe
you folks can give me a hand.

I am trying to migrate a Struts1 site to Struts2 (from maven, struts-core
2.0.6).  So far everything is fine, except for Velocity (verison 1.4). The
Action is being called and returning successfully, the correct Velocity
template is being loaded and parsed, but the Action is no where to be
found
for the Velocity template. In http://cwiki.apache.org/WW/velocity.html it
states that the Action's properties will be present for the template
context, along with other help variables (i.e. $stack, $action, etc ). My
Velocity template has nothing, just $struts.valueStack in the request
attributes.

Seems like there is a final step missing that processes the Action into
the
Velocity context?

The entire site is already using Velocity, so migrating to Freemaker is
not
really an option at this time.


thanks,
Michael





--
"Hey you! Would you help me to carry the stone?" Pink Floyd


RE: Struts in Servlet 2.4

2007-04-17 Thread Rod Bollinger
Hi Tim,

For 2.4 the URIs have changed. They are now:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>

HTH,
-Rod

-Original Message-
From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 17, 2007 10:55
To: Struts Users Mailing List
Subject: RE: Struts in Servlet 2.4

> I'd still try it without it, because that's just the way I am ;)
 
> I mean, it's obviously there if you're enumerating over it...

I switched that directive to <% page session="true" %>, and it finds
Contact in Session context!

Apparently, specifying "true" makes "the session implicit variable"
available, according to a JSP book I have. But if I put Java code in the
page, and use request.session(), I can get the session even though I
specify "false". And it must be true that WL9 enforces this more
stringently than WL8. Weird, weird.

Now, on to the next disaster. I use JSTL tags, c: and fmt: type. So I
have these page directives:

<%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt"; prefix="fmt" %>

I get this message for both tags:

No tag library could be found with this URI. Possible causes could be 
that the URI is incorrect, or that there were errors during parsing of
the .tld file.

Since I'm in servlets version 2.4, I've gotten rid of all of Struts's
jstl and EL libraries, since JSTL and EL are supposed to be builtin
here. I guess I got something wrong, but I don't know what.


--
Tim Slattery
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Velocity in Struts2

2007-04-17 Thread Martin Gainty
would it be possible to acomplish this in a staged environment in other 
words

preprocess all your code with Velocity Macros from Ant script
http://vpp.sourceforge.net/
this way you can see your jsps and servlet code

then feed the vpp output to struts2?
M---
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Michael" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, April 17, 2007 11:04 AM
Subject: Velocity in Struts2



Hello,

I have scratched my head and googled this for hours to no avail, so maybe
you folks can give me a hand.

I am trying to migrate a Struts1 site to Struts2 (from maven, struts-core
2.0.6).  So far everything is fine, except for Velocity (verison 1.4). The
Action is being called and returning successfully, the correct Velocity
template is being loaded and parsed, but the Action is no where to be 
found

for the Velocity template. In http://cwiki.apache.org/WW/velocity.html it
states that the Action's properties will be present for the template
context, along with other help variables (i.e. $stack, $action, etc ). My
Velocity template has nothing, just $struts.valueStack in the request
attributes.

Seems like there is a final step missing that processes the Action into 
the

Velocity context?

The entire site is already using Velocity, so migrating to Freemaker is 
not

really an option at this time.


thanks,
Michael




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 select tag multiple select

2007-04-17 Thread Nate Drake
What version of Struts2 are you using?  There is a bug in versions before 2.0.7,
where the select tag won't pre-select your values unless it is comparing 
Strings.  

See this Jira issue for details:

https://issues.apache.org/struts/browse/WW-1711






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts in Servlet 2.4

2007-04-17 Thread Slattery, Tim - BLS
> I'd still try it without it, because that's just the way I am ;)
 
> I mean, it's obviously there if you're enumerating over it...

I switched that directive to <% page session="true" %>, and it finds
Contact in Session context!

Apparently, specifying "true" makes "the session implicit variable"
available, according to a JSP book I have. But if I put Java code in the
page, and use request.session(), I can get the session even though I
specify "false". And it must be true that WL9 enforces this more
stringently than WL8. Weird, weird.

Now, on to the next disaster. I use JSTL tags, c: and fmt: type. So I
have these page directives:

<%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt"; prefix="fmt" %>

I get this message for both tags:

No tag library could be found with this URI. Possible causes could be 
that the URI is incorrect, or that there were errors during parsing of
the .tld file.

Since I'm in servlets version 2.4, I've gotten rid of all of Struts's
jstl and EL libraries, since JSTL and EL are supposed to be builtin
here. I guess I got something wrong, but I don't know what.


--
Tim Slattery
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Velocity in Struts2

2007-04-17 Thread Michael

Hello,

I have scratched my head and googled this for hours to no avail, so maybe
you folks can give me a hand.

I am trying to migrate a Struts1 site to Struts2 (from maven, struts-core
2.0.6).  So far everything is fine, except for Velocity (verison 1.4). The
Action is being called and returning successfully, the correct Velocity
template is being loaded and parsed, but the Action is no where to be found
for the Velocity template. In http://cwiki.apache.org/WW/velocity.html it
states that the Action's properties will be present for the template
context, along with other help variables (i.e. $stack, $action, etc ). My
Velocity template has nothing, just $struts.valueStack in the request
attributes.

Seems like there is a final step missing that processes the Action into the
Velocity context?

The entire site is already using Velocity, so migrating to Freemaker is not
really an option at this time.


thanks,
Michael


[s2] Do I still need a business service layer ?

2007-04-17 Thread nicolas de loof

Hello,

I've used struts1 for several years and I'm now looking at Struts².

In struts1, to create a "registerUser" use-case I need a RegisterAction, a
RegistrationService and some business code.
My struts1 RegistrationService is only used to start a transaction using
Spring @Transactional annotation. Hibernate does all the required job.

In struts2, AFAIK I can use any POJO as controler. Can I use my (maybe
adapted) RegistrationService as a Controller by simply changing to a
statefull model (user to register is not a method parameter anymore but a
bean property) ? This would make things really simplier !

Nico.


Re: struts2 equivalent of html:link tag?

2007-04-17 Thread Ian Roughley
My mistake (perhaps), I was scanning the email too fast.  It doesn't 
have the action and namespace attributes.  But it's not just for making 
dojo ajax requests either.  The href attribute can use the %{} notation 
to search the value stack and resolve expressions.


I usually use the two together -

   
   Register


/Ian

Dave Newton wrote:

--- Ian Roughley <[EMAIL PROTECTED]> wrote:
  

 generates a link in s2, you can use the
action and namespace attributes with it.



 is pretty different than  and I
would think not what the OP was looking for, which was
how to give links "logical" names.

I think the issue was largely solved by using
class-less (like me!) actions thusly:


  /a/jsp/etc


AFAICT  is for making Dojo Ajax requests.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


Questions on action chaining and validation in struts2 - please help

2007-04-17 Thread aj123

Hi
I am trying to use action chaining in struts2 and am stuck. Any help would
be really appreciated.

Scenario - I have a page that shows a list of records and also has a form to
add a new record. When user clicks on add I call addAction and chain it to
list action to go back to list page again showing the newly added record.

My struts.xml looks something like this ->


   
   list
   
   list


   /proj/list.jsp


I have 2 issues/questions - 
a) My validation does not work if I chain actions. If I don't enter anything
in add textbox and click on Add then I get a html 404 error. If I route to
list.jsp instead of chaning to list action then I see validation messages.
But I really need to show list on that page as well. So I can not forward to
the jsp.

b) When I chain 2 actions, can I pass new params for second action? It does
not seem to work for me e.g. In following example, I can not pass foo param
to list action that is chained to add action.



list
bar

list


I would really appreciate some feedback/help here.
-- 
View this message in context: 
http://www.nabble.com/Questions-on-action-chaining-and-validation-in-struts2---please-help-tf3590988.html#a10036082
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Client-side validation

2007-04-17 Thread Veronica Iturrioz
I have a form with client side validation:

  
  

and an Action with some annotated validations:

@Validations(
requiredStrings = {
@RequiredStringValidator( message = "Required", type = 
ValidatorType.FIELD,fieldName = "name", trim = 
true, key="error.required")


but I get an error because of the key property. If  I delete the key property, 
the client validation executes ok.
In the package.properties I've the error.required key. 

How can I do this? I want to execute client-validation with key messages. 

I try to create a new theme, and replace form-close-validate.ftl :
i replace the line:var error = 
"${validator.getMessage(action)?js_string}";
for:
<#if validator.defaultMessage?has_content>
  var error = "${validator.defaultMessage?js_string}";
 <#else>
 var error = 
"${action.getText(validator.getMessageKey())?js_string}";
 

but the client validation is not executed.  Some themes do not support 
client-side validation. Only useful with theme xhtml/ajax

thanks in advance.
Veronica






__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[ANN] [S2] WebWork 2.2.5 RELEASED

2007-04-17 Thread Ted Husted

From the WebWork 2.2.5 release notes:


"This 2.2.5 release, 6 months after WebWork 2.2.4, marks the final
chapter for the WebWork framework. Struts 2, its successor, had its
first GA release, and in a final push, the WebWork team wanted to do a
big effort to bring in as many optimizations and bug fixes as possible
before shifting developer focus.

"This release is fully backwards compatible with WebWork 2.2.4. You
can just replace the existing WebWork and XWork jars with the news
ones from 2.2.5.

"Like always, we would like to thank both regular users and
contributors, for helping out, submitting patches, testing, and
providing general feedback. The development of WebWork 2 and XWork 1
slowly grinds to a halt, so if you're looking for bleeding edge
technologies or new features, you are more than welcome to try Struts
2."

Hopefully, Struts 2.0.8 and Struts 2.1.0 won't be far behind :)

-Ted


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts2 equivalent of html:link tag?

2007-04-17 Thread Ian Roughley
 generates a link in s2, you can use the action and namespace 
attributes with it.


Dave Newton wrote:

--- Allen Gilliland <[EMAIL PROTECTED]> wrote:
  


  

okay, but at that point there is no real reason to
use the s:url tag at all 



If you're not dealing with contexts, perhaps not.

  

login page

and had this in your struts config file ...


   




In S1 my impression was that it was generally
recommended to direct all requests through actions to
avoid problems like this; that's one reason why the
ForwardAction and the forward attribute were
introduced: ending up with a link to a JSP is mostly
broken (IMO, anyway).

  

does struts2 have any equivalent for that?



AFAIK not beyond what has already been shown.

If you're simply dispatching to a JSP or something
else the normal container dispatcher can handle, why
not just add the following to your struts config?


  /WEB-INF/jsp/the.jsp


d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


Re: Struts 1.3.8: "Sidebar: Sharing JAR Files Across Web Applications"

2007-04-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Craig,

Craig McClanahan wrote:
> The naive way for a library to do this is:
>
>String className = ...; // Calculate the name of the class you want
>Class clazz = Class.forName(className);
> 
> * If commons-foo.jar is stored in a shared classloader provided by your
>  container, you'll get a ClassNotFoundException.  That happens because
>  Class.forName() and friends start from the classloader that loaded the
>  calling class itself (i.e. the commons-foo class doing this work) ... but
>  your application class is not visible because you can only look *up* a
>  classloader hierarchy, not down.

Can you briefly explain how struts even works when loaded from a shared
ClassLoader? My reading of this suggests that shared struts would not be
able to load actions found in the webapp's ClassLoader(s), but it sounds
like the OP has done this successfully.

I'm just curious how it is done because you say above that this is a
naive implementation... how does one do this in a smart way? It's not
too relevant to the question... just thought I'd take the opportunity to
find out since I've never heard of a good way to search "down" the
ClassLoader hierarchy.

Thanks,
- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJMBM9CaO5/Lv0PARAqcPAJ9vnk8pj9El1gWtmqPv2smLYkSyxgCbBjOx
1nEpmu62YlqqDaqjHYLEkN8=
=HxZg
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Re: Force clean / reload a webapp

2007-04-17 Thread piloupy GOTTAPIL

No, validator-rules.xml isn't in my WEB-INF directory. It's in the
struts-core.jar file at location
org.apache.struts.validator.validator-rules.xml.

Here is the plugin declaration in my struts-config.xml :


 


As I said earlier, it's strange, because I don't always have these
errors, though I didn't make any change. For example, right now, as I
type these words, I don't have any error in eclipse.

But with or without these errors, the form's constraints are taken account.

piloupy

On 4/17/07, Nuwan Chandrasoma <[EMAIL PROTECTED]> wrote:

hi,

Are you sure you have the validator-rules.xml in your WEB-INF directory?

Thanks,

Nuwan.


- Original Message -
From: "piloupy GOTTAPIL" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Tuesday, April 17, 2007 8:20 AM
Subject: Re: [OT] Re: Force clean / reload a webapp


> There's no problem in my Java Build Path. I have no error and no
> warning on my WEB-INF/src. I only have errors and warnings on my
> WEB-INF directory :
>
> ERRORS :
> Severity and Description Path Resource Location Creation Time Id
> Validation rule "email" doesn't exist. /WEB-INF validation.xml line
> 28 1176797654656 31572
> Validation rule "required" doesn't exist. /WEB-INF validation.xml line
> 16 1176797654656 31569
> Validation rule "required" doesn't exist. /WEB-INF validation.xml line
> 19 1176797654656 31570
> Validation rule "required" doesn't exist. /WEB-INF validation.xml line
> 22 1176797654656 31571
>
> For theses errors, I really don't know why they are here. I've
> included the right libraries and my site's working. Moreover, when I
> open the WEB-INF/validation.xml, the errors disappear (sometimes),
> sometimes, they don't. dunno why ^^;
>
> WARNINGS :
> Severity and Description Path Resource Location Creation Time Id
> The file cannot be validated as the host "struts.apache.org" is
> currently unreachable. /WEB-INF tiles-defs.xml line
> 5 1176735959046 31518
>
> The warning is on the URL line :
>
>   "-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
>  "http://struts.apache.org/dtds/tiles-config_1_3.dtd";>
>
> I don't know what to do for this warning. The dtd file is perfectly
> reacheable from the struts website, and this file is in my
> struts-tiles library.
>
> I indeed use WTP and Subclipse.
>
> piloupy
>
> On 4/16/07, Dave Newton <[EMAIL PROTECTED]> wrote:
>> --- piloupy GOTTAPIL wrote:
>> > That's how I configured eclipse in the Build Path.
>> > WEB-INF/src --(compile_to)--> WEB-INF/classes.
>> >
>> > But eclipse doesn't seem to rebuild the classes. I
>> > think it's because the element that needs these
>> files
>> > is tomcat, and not a simple java application.
>>
>> It shouldn't matter; are there any items in your
>> "Problems" view or warnings in the java build path
>> dialog box? Are you using something like MyEclipse or
>> WTP?
>>
>> I have no issues with automatically building my web
>> apps.
>>
>> d.
>>
>>
>> __
>> Do You Yahoo!?
>> Tired of spam?  Yahoo! Mail has the best spam protection around
>> http://mail.yahoo.com
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts2 equivalent of html:link tag?

2007-04-17 Thread Dave Newton
--- Ian Roughley <[EMAIL PROTECTED]> wrote:
>  generates a link in s2, you can use the
> action and namespace attributes with it.

 is pretty different than  and I
would think not what the OP was looking for, which was
how to give links "logical" names.

I think the issue was largely solved by using
class-less (like me!) actions thusly:


  /a/jsp/etc


AFAICT  is for making Dojo Ajax requests.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Fwd: Call for Papers Opens for ApacheCon US 2007

2007-04-17 Thread Ted Husted

Note: The CFP announcement was inadvertently delayed, so the deadline
is unusually close this year. If you'd like to submit a proposal, get
busy!

-- Forwarded message --
From: Rich Bowen <[EMAIL PROTECTED]>
Date: Apr 16, 2007 10:40 AM
Subject: Call for Papers Opens for ApacheCon US 2007
To: [EMAIL PROTECTED]


Call for Papers Opens for ApacheCon US 2007

The Call for Papers is now open for ApacheCon US, to be held November
12-16 at the Peachtree Westin, Atlanta. The conference will consist
of two day of tutorials (November 12-13) and three days of regular
conference sessions (November 14-16).

Please log in to the website at http://apachecon.com/html/login.html
to submit your proposal. Further details about fees and are
avaialable on the CFP form.

Topics appropriate for submission to this conference are manifold,
and may include but are not restricted to:

* ASF projects
* ASF-Incubated projects
* Scripting languages and dynamic content such as Java, Perl, Python,
Ruby, XSL, and PHP
* New technologies and broader initiatives such as Web Services and
Web 2.0
* Security and e-commerce, performance tuning, load balancing, and
high availability
* Business and community issues surrounding the ASF and Open Source

The paper submission deadline is Monday, 28 April 2007, Midnight GMT.

Thanks, and we hope to hear from you, and to see you in Atlanta.

--
The ApacheCon Planners
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Interceptors and thread-safety

2007-04-17 Thread Dave Newton
--- Dale Newfield <[EMAIL PROTECTED]> wrote:
> [...] so that implies only a single simultaneous use

> of a single execAndWait action per login?

>From the execAndWait JavaDoc:

"""
This interceptor works on a per-session basis. That
means that the same action name (myLongRunningAction,
in the above example) cannot be run more than once at
a time in a given session.
"""

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Map-backed forms in Struts2

2007-04-17 Thread Lance

Do you have a getValue(String key) method?
I am not a s2 user but I have read the OGNL spec so sorry if I'm wrong 
but OGNL needs

  public PropertyType getPropertyName(IndexType index)
  and public void setPropertyName(IndexType index, PropertyType value)

http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html#N10189

James Navin wrote:

Hi all,

A system I am developing requires forms to be generated dynamically at
runtime based on data stored in a database. I have read that it is possible
to use map-backed forms in Struts1 to achieve this using something of the
form '' where the
associated Action class has a method of the form 'public void
setValue(String key, Object value)', resulting in name-value pairs being
submitted to the Action class.

Is this possible to achieve in Struts2? I have not been able to make it
work. When I use the above expression for the name attribute the setValue
method is never called (I have checked this with a few debug print
statements), but no exception is thrown either. It just appears that
nothing happens.

Is this something I am doing wrong, or is there some other way to do this
in Struts2, or is it a bug?

I am using Struts 2.0.6 with Java 1.5.3, Tomcat 5.5 and Internet Explorer
6.

Thanks a lot in advance,

James


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Re: Force clean / reload a webapp

2007-04-17 Thread Nuwan Chandrasoma

hi,

Are you sure you have the validator-rules.xml in your WEB-INF directory? 


Thanks,

Nuwan.


- Original Message - 
From: "piloupy GOTTAPIL" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Tuesday, April 17, 2007 8:20 AM
Subject: Re: [OT] Re: Force clean / reload a webapp



There's no problem in my Java Build Path. I have no error and no
warning on my WEB-INF/src. I only have errors and warnings on my
WEB-INF directory :

ERRORS :
Severity and Description Path Resource Location Creation Time Id
Validation rule "email" doesn't exist. /WEB-INF validation.xml line
28 1176797654656 31572
Validation rule "required" doesn't exist. /WEB-INF validation.xml line
16 1176797654656 31569
Validation rule "required" doesn't exist. /WEB-INF validation.xml line
19 1176797654656 31570
Validation rule "required" doesn't exist. /WEB-INF validation.xml line
22 1176797654656 31571

For theses errors, I really don't know why they are here. I've
included the right libraries and my site's working. Moreover, when I
open the WEB-INF/validation.xml, the errors disappear (sometimes),
sometimes, they don't. dunno why ^^;

WARNINGS :
Severity and Description Path Resource Location Creation Time Id
The file cannot be validated as the host "struts.apache.org" is
currently unreachable. /WEB-INF tiles-defs.xml line
5 1176735959046 31518

The warning is on the URL line :

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

I don't know what to do for this warning. The dtd file is perfectly
reacheable from the struts website, and this file is in my
struts-tiles library.

I indeed use WTP and Subclipse.

piloupy

On 4/16/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- piloupy GOTTAPIL wrote:
> That's how I configured eclipse in the Build Path.
> WEB-INF/src --(compile_to)--> WEB-INF/classes.
>
> But eclipse doesn't seem to rebuild the classes. I
> think it's because the element that needs these
files
> is tomcat, and not a simple java application.

It shouldn't matter; are there any items in your
"Problems" view or warnings in the java build path
dialog box? Are you using something like MyEclipse or
WTP?

I have no issues with automatically building my web
apps.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Re: Force clean / reload a webapp

2007-04-17 Thread piloupy GOTTAPIL

There's no problem in my Java Build Path. I have no error and no
warning on my WEB-INF/src. I only have errors and warnings on my
WEB-INF directory :

ERRORS :
Severity and DescriptionPathResourceLocation
Creation Time   Id
Validation rule "email" doesn't exist./WEB-INFvalidation.xml  
line
28  1176797654656   31572
Validation rule "required" doesn't exist. /WEB-INFvalidation.xml  
line
16  1176797654656   31569
Validation rule "required" doesn't exist. /WEB-INFvalidation.xml  
line
19  1176797654656   31570
Validation rule "required" doesn't exist. /WEB-INFvalidation.xml  
line
22  1176797654656   31571

For theses errors, I really don't know why they are here. I've
included the right libraries and my site's working. Moreover, when I
open the WEB-INF/validation.xml, the errors disappear (sometimes),
sometimes, they don't. dunno why ^^;

WARNINGS :
Severity and DescriptionPathResourceLocation
Creation Time   Id
The file cannot be validated as the host "struts.apache.org" is
currently unreachable.  /WEB-INFtiles-defs.xml  line
5   1176735959046   31518

The warning is on the URL line :

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

I don't know what to do for this warning. The dtd file is perfectly
reacheable from the struts website, and this file is in my
struts-tiles library.

I indeed use WTP and Subclipse.

piloupy

On 4/16/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- piloupy GOTTAPIL wrote:
> That's how I configured eclipse in the Build Path.
> WEB-INF/src --(compile_to)--> WEB-INF/classes.
>
> But eclipse doesn't seem to rebuild the classes. I
> think it's because the element that needs these
files
> is tomcat, and not a simple java application.

It shouldn't matter; are there any items in your
"Problems" view or warnings in the java build path
dialog box? Are you using something like MyEclipse or
WTP?

I have no issues with automatically building my web
apps.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 1.3.8: "Sidebar: Sharing JAR Files Across Web Applications"

2007-04-17 Thread Craig McClanahan

On 4/16/07, Ken Miller <[EMAIL PROTECTED]> wrote:


Can someone point me (or at least give me a clue) where a potential
problem may exist?  I've configured my server to have a shared set of
Commons and Struts jars (something I did before reading the above
paragraph), and it appears to work, but I'd like to investigate a few
situations which may cause problems to better understand the possible
pitfalls.



There are at least two potential scenarios to watch out for.

First, consider a case where you have a library commons-foo that your
webapp depends on.  Now, assume this library has a static variable
"bar" defined in one of its classes.  The challenge you have different
semantics depending on where commons-foo.jar is located.

* If commons-foo.jar is within /WEB-INF/lib, the static variable is
 global only to that particular web application.  If two different webapps
 use this library, their uses of the static variable do not conflict.

* If commons-foo.jar is stored in a shared classloader provided by your
 container (for example, in the shared/lib or common/lib directory for Tomcat)
 the global is shared *across* webapps, and any changes from webapp A
 can adversely impact webapp B.

Second, consider what happens if library commons-foo needs to
dynamically instantiate an instance of an application-provided class.
The naive way for a library to do this is:

   String className = ...; // Calculate the name of the class you want
   Class clazz = Class.forName(className);

Again, there are two different semantics (assuming the class to be
loaded is part of your webapp, not part of the shared hierarchy):

* If commons-foo.jar is within /WEB-INF/lib, the classloader can see your
 application class, and load it with no problems.

* If commons-foo.jar is stored in a shared classloader provided by your
 container, you'll get a ClassNotFoundException.  That happens because
 Class.forName() and friends start from the classloader that loaded the
 calling class itself (i.e. the commons-foo class doing this work) ... but
 your application class is not visible because you can only look *up* a
 classloader hierarchy, not down.

The libraries that Struts itself depends on have likely shaken out
most of the bugs like this since I wrote those warnings several years
ago :-).  But the only way to figure out if an arbitrary library will
work in a shared environment is to exhaustively test and/or audit the
code for statics and dynamic object creation.

Craig

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles-defs.xml and extended attributes...

2007-04-17 Thread Antonio Petrelli

2007/4/17, Rod Bollinger <[EMAIL PROTECTED]>:

Hi Antonio,

I agree that that works. In fact, both approaches function identically. That
is not the issue. The only issue I was raising was how to make the
SimpleMenuItem extension attributes validate properly in an IDE. Since, they
are not declared in the DTD, I fear that XML validation will not be possible
(without raising the errors of course).


What do you mean with "extension attributes"? Are they bean properties
of your SimpleMenuItem-subclassed class?

Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]