Author Login
Post Reply
user Digest 21 Mar 2008 11:05:44 -0000 Issue 7939
Topics (messages 184497 through 184517):
Re: About tag <bean>
184497 by: Chen Chunwei
184498 by: Antonio Petrelli
184499 by: Chen Chunwei
Using xdoclets and minlength from validator
184500 by: Dimitris Mouchritsas
Re: struts 2 jsf plugin problem
184501 by: Nils-Helge Garli Hegvik
184505 by: Daniel
Re: File Upload Size
184502 by: Richard Sayre
184503 by: Lukasz Lenart
Re: Struts 1 vs Struts 2 actionform execution and Struts2 POJO example
184504 by: bugs_
OGNL Method calls & class static properties
184506 by: Michael Gagnon
184510 by: Dave Newton
Using Javascript to change struts-generated forms
184507 by: Allen, Daniel
184515 by: Jeromy Evans
Best Pratices for Access Restriction and Authentication?
184508 by: Frank Fischer
184509 by: Lukasz Lenart
Any issues using latest Dojo with Struts2?
184511 by: Karr, David
184512 by: Dave Newton
184513 by: Karr, David
184514 by: Dave Newton
Exception in running application
184516 by: aum strut
s2 : assigning a variable to jsp
184517 by: niels
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_184497.ezm (zipped)Thanks Antonio.
Yes, this is exactly what I want.
And this is my fourth day to learn about JSP, STRUTS and everything about JAVA. So I found there are too much to learn, whereas I don't have much time to learn it systematically and I don't have enough materials to learn it from espesially that I cannot access Internet except e-mail. So this mail list is the only way that I can ask my questions.
Talos
----- Original Message -----
From: "Antonio Petrelli" <antonio.petrelli@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Thursday, March 20, 2008 4:03 PM
Subject: Re: About tag <bean>
2008/3/20, Chen Chunwei <out-chenchunwei@(protected)>:
> Can tag <bean> fetch the value processed by a specified ActionForm?
> For instance, there's an ActionForm named TestActionForm, which has a field defined with "String test". And the corresponding get-method getTest() will add a prefix "p:" to the field test. Supposing the origin value of test is "a", then whether I can use tag <bean> to get the processed value "p:a"? If can, then how?
I suppose that you are writing about <bean:write>.
Well, you can do it by using:
<bean:write name="formBeanName" property="test" />
"formBeanName" is the name that you declared in your
struts-config.xml, along with the called action.
The "getTest" will get called.
Antonio
P.S.: It seemed too simple to be true. Is it really this what you want?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_184498.ezm (zipped)2008/3/20, Chen Chunwei <out-chenchunwei@(protected)>:
>
> And this is my fourth day to learn about JSP, STRUTS and everything about
> JAVA. So I found there are too much to learn, whereas I don't have much time
> to learn it systematically and I don't have enough materials to learn it
> from espesially that I cannot access Internet except e-mail. So this mail
> list is the only way that I can ask my questions.
Oh dear!
A colleague of mine asks if you are in jail :-D
Antonio

Attachment:
user_184499.ezm (zipped)Almost. :-(
Talos
----- Original Message -----
From: "Antonio Petrelli" <antonio.petrelli@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Thursday, March 20, 2008 5:01 PM
Subject: Re: About tag <bean>
2008/3/20, Chen Chunwei <out-chenchunwei@(protected)>:
>
> And this is my fourth day to learn about JSP, STRUTS and everything about
> JAVA. So I found there are too much to learn, whereas I don't have much time
> to learn it systematically and I don't have enough materials to learn it
> from espesially that I cannot access Internet except e-mail. So this mail
> list is the only way that I can ask my questions.
Oh dear!
A colleague of mine asks if you are in jail :-D
Antonio

Attachment:
user_184500.ezm (zipped)Hi all, I'm trying to make a password field be at least 6 characters in
length but the check doesn't seem to work.
Here's my code:
/**
* @struts.validator type="required,minlength,maxlength,mask"
*
* @struts.validator-var name="minlength" value="5"
* @struts.validator-var name="maxlength" value="20"
* @struts.validator-var name="mask" value="^[a-zA-Z_0-9-]*$"
*
* @struts.validator-args arg0resource="prompt.password"
* @struts.validator-args arg1value="${var:minlength}"
* @struts.validator-args arg2value="${var:maxlength}"
*
* @param password The password to set.
*/
public void setPassword(String password) {
this.password = password;
}
Any ideas? Thanks

Attachment:
user_184501.ezm (zipped)First of all, I'm not even sure if it's possible to use the portlet
and the jsf plugin at the same time. I have not tried, but there might
be issues with it if they try to do conflicting things in the
interceptors and the results.
> struts.xml
>
> <package name="default" extends="portlet-jsf-default" namespace="/view">
>
> <action name="index" class="com.mycompany.HelloAction">
> <interceptor-ref name="basicStack"/>
> <interceptor-ref name="jsfStack"/>
> <result name="success" type="jsf"/>
> <result>/WEB-INF/jsp/view/index.jsp</result>
> </action>
> </package>
>
A couple of things here. You're extending portlet-jsf-default, which
still has the jsfStack as the default interceptor ref. Since you have
defined a "jsf" package that extends "portlet-jsf-default", you should
probably extend the "jsf" package instead. However, it's probably just
as easy configuring the correct interceptor stack and default
interceptor ref right there in the "portlet-jsf-default" package. In
addition, you're overriding the default interceptor stack in your
action definition, so it's not really using the portletDefaultStack,
even if you had configured your default interceptor stack correctly.
Unless you need to use different interceptors in your action, there's
no need configuring those interceptor-refs there.
You could also try swapping the order of the portletDefaultStack and
the jsfStack and see if that makes a difference.
Nils-H

Attachment:
user_184505.ezm (zipped)I have changed the myfaces lib with jsf lib.
Now i am getting the error :
javax.portlet.PortletExceptionat com.bea.portlet.container.PortletRequestDispatcherImpl.include(
PortletRequestDispatcherImpl.java:143)
at
org.apache.struts2.portlet.result.PortletResult.executeRenderResult(
PortletResult.java:200)
at
org.apache.struts2.portlet.result.PortletResult.doExecute(
PortletResult.java:91)
at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(
StrutsResultSupport.java:185)
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(
DefaultActionInvocation.java:355)
Truncated. see log file for complete stacktrace
javax.servlet.ServletException: weblogic.servlet.jsp.CompilationException:
Failed to compile JSP /WEB-INF/jsp/view/index.jsp
index.jsp:16:26: No property editor found for the bean "
javax.el.ValueExpression".
<h:panelGrid columns="3">
-
index.jsp:17:29: No property editor found for the bean "
javax.el.ValueExpression".
<h:outputText value="Employee Id:" />
------------
index.jsp:22:26: No property editor found for the bean "
javax.el.ValueExpression".
<h:outputText value="Back" />
----
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java
:247)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(
ServletStubImpl.java:391)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java
:309)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java
:42)
Truncated. see log file for complete stacktrace
weblogic.servlet.jsp.CompilationException: Failed to compile JSP
/WEB-INF/jsp/view/index.jsp
index.jsp:16:26: No property editor found for the bean "
javax.el.ValueExpression".
<h:panelGrid columns="3">
-
index.jsp:17:29: No property editor found for the bean "
javax.el.ValueExpression".
<h:outputText value="Employee Id:" />
------------
index.jsp:22:26: No property editor found for the bean "
javax.el.ValueExpression".
<h:outputText value="Back" />
----
at weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java
:296)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:200)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java
:235)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(
ServletStubImpl.java:391)
Truncated. see log file for complete stacktrace
This message is thrown after my action method is called (execute).
My JSP file :
<%@(protected)" %>
<%@(protected)" %>
<f:view>
<html>
<!-- todo: make header variable -->
<head>
<title>JSF Integration Examples</title>
</head>
<body>
Modify Employee
<h:form>
<h:panelGrid columns="3">
<h:outputText value="Employee Id:" />
</h:panelGrid>
<h:outputLink>
<h:outputText value="Back" />
</h:outputLink>
</h:form>
</body>
</html>
</f:view>
On Thu, Mar 20, 2008 at 12:43 PM, Nils-Helge Garli Hegvik <nilsga@(protected)>
wrote:
> First of all, I'm not even sure if it's possible to use the portlet
> and the jsf plugin at the same time. I have not tried, but there might
> be issues with it if they try to do conflicting things in the
> interceptors and the results.
>
> > struts.xml
> >
> > <package name="default" extends="portlet-jsf-default"
> namespace="/view">
> >
> > <action name="index" class="com.mycompany.HelloAction">
> > <interceptor-ref name="basicStack"/>
> > <interceptor-ref name="jsfStack"/>
> > <result name="success" type="jsf"/>
> > <result>/WEB-INF/jsp/view/index.jsp</result>
> > </action>
> > </package>
> >
>
> A couple of things here. You're extending portlet-jsf-default, which
> still has the jsfStack as the default interceptor ref. Since you have
> defined a "jsf" package that extends "portlet-jsf-default", you should
> probably extend the "jsf" package instead. However, it's probably just
> as easy configuring the correct interceptor stack and default
> interceptor ref right there in the "portlet-jsf-default" package. In
> addition, you're overriding the default interceptor stack in your
> action definition, so it's not really using the portletDefaultStack,
> even if you had configured your default interceptor stack correctly.
> Unless you need to use different interceptors in your action, there's
> no need configuring those interceptor-refs there.
>
> You could also try swapping the order of the portletDefaultStack and
> the jsfStack and see if that makes a difference.
>
> Nils-H
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_184502.ezm (zipped)No it doesn't
On Wed, Mar 19, 2008 at 2:14 PM, Lukasz Lenart
<lukasz.lenart@(protected):
> Does your action implements ValidationAware interface?
>
>
>
>
>
> Regards
> --
> Lukasz
>
> http://www.linkedin.com/in/lukaszlenart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_184503.ezm (zipped)> No it doesn't
Maybe that's the problem, FileUploadInterceptor check if action
implements it and add error messages. If you implement it, remember to
add result name=input.
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart

Attachment:
user_184504.ezm (zipped)
What I need is to have one action and many various (POJO) objects, which
polulate and receive date from html form. POJO object should be selected by
the form, which is displayed (or submited). But I realy don't know how to do
this in Struts 2.
newton.dave wrote:
>
> --- bugs_ <bugsmail@(protected):
>> Can me anybody give a simple example: How to use an POJO object in Struts
>> 2
>> (instead of ActionForm)?
>
> http://struts.apache.org/2.x/docs/hello-world.html
>
> See the form creation/using the form bits.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184506.ezm (zipped)Is it valid to, within the scope if a s:if tag, to:
a) Call non getter/setter methods on a bean on the stack
b) Reference some unrelated class' public static field (without a
getter method)
To give the situation some context, I'm attempting to do something similar
to the following:
<s:iterator value="someSet" status="stat" id="next">
<s:property value="name"/>
.etc.
<s:if test="hasRoleType(user,
database.roles.RoleTypeEnum.ADMIN)">
Add some link
</s:if>
</s:iterator>
Where the calling action has a method getSomeSet which returns a set of
objects containing a hasRoleType method. The hasRoleType method takes two
parameters and returns a boolean.
The calling action also has a method getUser which returns a 'User' object.
database.roles.RoleTypeEnum is just a class on the classpath - not
referenced in any way by the action - which has a 'public static RoleType
ADMIN' field. This field has no getters or setters.
What I *expect* to magically happen in a perfect world is that:
OGNL looks for hasRoleType method on the next iterating object -
this should have highest priority on the stack. Being found (and having a
return type of boolean) this method should be set to be called
OGNL looks for 'getUser' method on the next iterating object.
Not being found, it checks the action for a getUser method. It finds it and
uses it.
OGNL looks for 'getDatabase' on the iterating object. Doesn't
find it. Checks on the action. Doesn't find it. Then maybe it shrugs its
shoulders and decides it's a qualified java class with a field? I guess
that's a stretch.
Is there some syntax for calling a method on that next object on the stack,
and is there also some syntax for making a static reference like that
(Without taking the trouble of putting a getXX method in the action to just
return it)?
Any thoughts/insights would be appreciated, thanks!

Attachment:
user_184510.ezm (zipped)Static access:
http://struts.apache.org/2.x/docs/ognl-basics.html
--- Michael Gagnon <mgagnon@(protected):
> Is it valid to, within the scope if a s:if tag, to:
>
> a) Call non getter/setter methods on a bean on the stack
>
> b) Reference some unrelated class' public static field (without a
> getter method)
>
>
>
> To give the situation some context, I'm attempting to do something similar
> to the following:
>
> <s:iterator value="someSet" status="stat" id="next">
>
> <s:property value="name"/>
>
> .etc.
>
> <s:if test="hasRoleType(user,
> database.roles.RoleTypeEnum.ADMIN)">
>
> Add some link
>
> </s:if>
>
> </s:iterator>
>
>
>
> Where the calling action has a method getSomeSet which returns a set of
> objects containing a hasRoleType method. The hasRoleType method takes two
> parameters and returns a boolean.
>
>
>
> The calling action also has a method getUser which returns a 'User' object.
>
>
>
> database.roles.RoleTypeEnum is just a class on the classpath - not
> referenced in any way by the action - which has a 'public static RoleType
> ADMIN' field. This field has no getters or setters.
>
>
>
> What I *expect* to magically happen in a perfect world is that:
>
> OGNL looks for hasRoleType method on the next iterating object
> -
> this should have highest priority on the stack. Being found (and having a
> return type of boolean) this method should be set to be called
>
>
>
> OGNL looks for 'getUser' method on the next iterating object.
> Not being found, it checks the action for a getUser method. It finds it and
> uses it.
>
>
>
> OGNL looks for 'getDatabase' on the iterating object. Doesn't
> find it. Checks on the action. Doesn't find it. Then maybe it shrugs its
> shoulders and decides it's a qualified java class with a field? I guess
> that's a stretch.
>
>
>
> Is there some syntax for calling a method on that next object on the stack,
> and is there also some syntax for making a static reference like that
> (Without taking the trouble of putting a getXX method in the action to just
> return it)?
>
>
>
> Any thoughts/insights would be appreciated, thanks!
>
>

Attachment:
user_184507.ezm (zipped)Hi, all.
I'm working on a form that would allow some arbitrary number of
documents to be uploaded at once. The idea is that by default, one set
of document fields appears, and there's a link that a user can click to
activate some javascript that would add another set of document fields.
I have this basically working. The new fields are named the same as the
old fields, and that works just fine, with Struts automatically making
those into array properties.
My question, though, is how to make it not look horrible. I've included
the JSP below, and as you can see, I have an invisible div that I clone
and insert into the DOM tree before the Submit button. What I want is
for the cloned portion to be added as additional table rows in the table
that Struts creates for the main form. Instead, the cloned portion ends
in a table inside of a single cell in the original form's table. How can
I write the JSP so that the cloned portion fits in nicely? Is this a job
for a new theme? Have I just taken the complete wrong approach?
Thanks,
Dan Allen
__________JSP below______________
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@(protected)" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Policy Uploads</title>
<s:head />
<%-- The Javascript will simply multiply the HTML code generated
by Struts for us, and the identical fieldnames
will cause Struts to see the form as working with indexed
properties.
See DocumentUploadAction.java --%>
<script language="JavaScript">
var fileCount = 1;
var clonedNode = null;
var insertLoc = null;
function addFileToForm() {
if(fileCount >= 5) {
alert("Please upload files in batches of
five or less, in order to maintain reasonable response times.");
return;
}
clonedNode =
document.getElementById('cloneTarget').cloneNode(true);
clonedNode.style.display = ''; // The clone
target has display "none"; drop that attribute.
insertLoc =
document.getElementById('documentSubmitButton');
insertLoc.parentNode.insertBefore(clonedNode ,
insertLoc);
fileCount = fileCount + 1;
}
</script>
</head>
<body>
<div id="cloneTarget" style="display: none">
<s:file name="documentFiles" label="File"/>
<s:select name="documentTypes" label="Type"
list="documentTypeChoices"/>
<s:textfield name="documentNames" label="Name"/> (leave
blank to copy the name from the uploaded file)
</div>
<s:form id="docsForm" method="POST"
action="documentUpload_execute" enctype="multipart/form-data">
<s:textfield name="policyId" label="Upload for Policy
#"/>
<hr/>
<s:file name="documentFiles" label="File"/>
<s:select name="documentTypes" label="Type"
list="documentTypeChoices"/>
<s:textfield name="documentNames" label="Name"/> (leave
blank to copy the name from the uploaded file)
<s:submit id="documentSubmitButton"/>
</s:form>
<br>
<hr>
<a href="javascript:addFileToForm()">Click here</a> to add more
files to the upload.
</body>
</html>
--
This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as "KBC FP").
This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, prices at which KBC FP would enter into a transaction, or prices at which similar transactions may be carried on KBC FP's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns.

Attachment:
user_184515.ezm (zipped)Yes, create a custom theme to get out of that table. css_xhtml may work
immediately.
Potential issues:
- Your current approach is also going to create nodes with duplicate
ids. This may confuse some browsers badly. At least remove the ID from
the template
- I'm not sure that order is guaranteed when you have two params with
the same name at time they are submitted. Ensure you can't get a
mismatch between doctype/doc name when uploading multuple files. ie.
doctype[1] is associated with docname[0]. It seems vulnerable to
browser-dependent processing of the form.
You may be safer generating the DOM nodes with JS programmatically
rather than doing a clone. That way you'll be able to assign unique
ID's for each node, add listeners for validation and use array notation
in your field names to guarantee order for struts eg. "doctype[1]".
hope that helps,
Jeromy Evans
Allen, Daniel wrote:
> Hi, all.
>
> I'm working on a form that would allow some arbitrary number of
> documents to be uploaded at once. The idea is that by default, one set
> of document fields appears, and there's a link that a user can click to
> activate some javascript that would add another set of document fields.
> I have this basically working. The new fields are named the same as the
> old fields, and that works just fine, with Struts automatically making
> those into array properties.
>
> My question, though, is how to make it not look horrible. I've included
> the JSP below, and as you can see, I have an invisible div that I clone
> and insert into the DOM tree before the Submit button. What I want is
> for the cloned portion to be added as additional table rows in the table
> that Struts creates for the main form. Instead, the cloned portion ends
> in a table inside of a single cell in the original form's table. How can
> I write the JSP so that the cloned portion fits in nicely? Is this a job
> for a new theme? Have I just taken the complete wrong approach?
>
> Thanks,
> Dan Allen
>
> __________JSP below______________
>
> <!DOCTYPE html PUBLIC
> "-//W3C//DTD XHTML 1.1 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <%@(protected)" %>
>
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <title>Policy Uploads</title>
> <s:head />
> <%-- The Javascript will simply multiply the HTML code generated
> by Struts for us, and the identical fieldnames
> will cause Struts to see the form as working with indexed
> properties.
> See DocumentUploadAction.java --%>
> <script language="JavaScript">
> var fileCount = 1;
> var clonedNode = null;
> var insertLoc = null;
>
> function addFileToForm() {
> if(fileCount >= 5) {
> alert("Please upload files in batches of
> five or less, in order to maintain reasonable response times.");
> return;
> }
> clonedNode =
> document.getElementById('cloneTarget').cloneNode(true);
> clonedNode.style.display = ''; // The clone
> target has display "none"; drop that attribute.
> insertLoc =
> document.getElementById('documentSubmitButton');
> insertLoc.parentNode.insertBefore(clonedNode ,
> insertLoc);
> fileCount = fileCount + 1;
> }
> </script>
> </head>
>
> <body>
> <div id="cloneTarget" style="display: none">
> <s:file name="documentFiles" label="File"/>
> <s:select name="documentTypes" label="Type"
> list="documentTypeChoices"/>
> <s:textfield name="documentNames" label="Name"/> (leave
> blank to copy the name from the uploaded file)
> </div>
> <s:form id="docsForm" method="POST"
> action="documentUpload_execute" enctype="multipart/form-data">
> <s:textfield name="policyId" label="Upload for Policy
> #"/>
> <hr/>
> <s:file name="documentFiles" label="File"/>
> <s:select name="documentTypes" label="Type"
> list="documentTypeChoices"/>
> <s:textfield name="documentNames" label="Name"/> (leave
> blank to copy the name from the uploaded file)
> <s:submit id="documentSubmitButton"/>
> </s:form>
> <br>
> <hr>
> <a href="javascript:addFileToForm()">Click here</a> to add more
> files to the upload.
> </body>
> </html>
>
>

Attachment:
user_184508.ezm (zipped)Hi all
Creating my first struts2 web application i came to the point where
questions about access restriction and authentication pop up.
I read some articles about these topics that cover certain single aspects
but none of them seem to answer all my questions.
As far as i learned, i think best way to implement authentication for
Actions is to implement a Interceptor which filters out requests and
redirect them to the login page as long as the requesting client was not
authenticated. And upon login i would store a param in the session which i
will look up in the Authentication Interceptor to find out if the client
already did authenticate.
Is that a good practise? Or are there better ways to do authentication? Any
special things to think about? I.e. what about session hijacking? Should i
also store the ip where the authentication credentials were sent from
initilally and check this ip against the ips of subsequent request related
to the same session?
So i implemented a simple AuthenticationInterceptor and deployed it. That
works so far, but only for requests to Actions. When requesting a jsp file
directly by url from the browser the jsp is delivered by tomcat. I don't
like to have users being able to directly access jsp without authentication.
Basically i thought that requests for jsp also would be passed to the
AuthenticationInterceptor (as far as i understand, an interceptor is
basically a servlet filter) so the same authentication checks would apply as
for Actions (servlets, and as far as i understand, jsps are also a kind of
servlets, so why should that be handled differently?). But this obv. Doesn't
work.
I found some articles that put a piece of code in each jsp, checking if a
kind of "logged-in" param is set in the session and does a redirect to a
login page if that isn't the case. To be honest, i don't like that method, i
wouldn't like to have such a statement on every jsp. I think there must be a
better, smarter way to do that.
I just read bout about Acegi (http://www.acegisecurity.org/). As far as i
understand this framework would provide mechanisms for authentication and
authorization (which also will be going to be a topic in a later project
stage). In its documentation i read that it's working with spring. Does this
only refere to Spring für DI, so i would be able to use Acegi also for
authentication in my Struts2 application (which already uses Spring for DI)
or does it only work with Spring Actions?
I'm very thankful for any tips and tricks or references for further reading.
Thanks a lot & regards
Frank

Attachment:
user_184509.ezm (zipped)> I just read bout about Acegi (http://www.acegisecurity.org/). As far as i
> understand this framework would provide mechanisms for authentication and
> authorization (which also will be going to be a topic in a later project
> stage). In its documentation i read that it's working with spring. Does this
> only refere to Spring für DI, so i would be able to use Acegi also for
> authentication in my Struts2 application (which already uses Spring for DI)
> or does it only work with Spring Actions?
It works very well with Struts2 or with any other web framework, even
there is some example how to develop Struts2 Interceptor in inject
Auth context to an action.
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart

Attachment:
user_184511.ezm (zipped)Isn't it the case that Struts2 integrates Dojo, but a version older than
the latest Dojo version? Should I expect any difficulties if I try to
use the latest Dojo in a Struts2 application? I imagine this might
preclude trying to use the Struts2 tags that use Dojo widgets (or just
need some additional config steps), so I guess I'd need to understand
the impact of that.
I also see that Dojo uses "${...}" references for variable substitution.
Will that cause problems if this code is in a JSP?

Attachment:
user_184512.ezm (zipped)--- "Karr, David" <david.karr@(protected):
> Isn't it the case that Struts2 integrates Dojo, but a version older than
> the latest Dojo version?
Yes.
> Should I expect any difficulties if I try to
> use the latest Dojo in a Struts2 application?
Not if you're not trying to combine the two versions; you can use "naked"
Dojo in an S2 app just like you would in any other framework.
> I also see that Dojo uses "${...}" references for variable substitution.
> Will that cause problems if this code is in a JSP?
I'm not sure what you mean there; do you have a link to what you're referring
to?
Dave

Attachment:
user_184513.ezm (zipped)The following link into the "Dojo Book" has an example. There are
others throughout the book. The "${...}" is substituted on the CLIENT
side.
http://dojotoolkit.org/node/3161
> -----Original Message-----
> From: Dave Newton [mailto:newton.dave@(protected)]
> Sent: Thursday, March 20, 2008 1:41 PM
> To: Struts Users Mailing List
> Subject: Re: Any issues using latest Dojo with Struts2?
>
> --- "Karr, David" <david.karr@(protected):
> > Isn't it the case that Struts2 integrates Dojo, but a version older
> > than the latest Dojo version?
>
> Yes.
>
> > Should I expect any difficulties if I try to use the latest
> Dojo in a
> > Struts2 application?
>
> Not if you're not trying to combine the two versions; you can
> use "naked"
> Dojo in an S2 app just like you would in any other framework.
>
> > I also see that Dojo uses "${...}" references for variable
> substitution.
> > Will that cause problems if this code is in a JSP?
>
> I'm not sure what you mean there; do you have a link to what
> you're referring to?
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

Attachment:
user_184514.ezm (zipped)Oh, the templates? Yeah, if you tried to use that notation on a JSP page it
would cause a problem. I'd imagine escaping the $ would work, although I
haven't tried it.
Dave
--- "Karr, David" <david.karr@(protected):
> The following link into the "Dojo Book" has an example. There are
> others throughout the book. The "${...}" is substituted on the CLIENT
> side.
>
> http://dojotoolkit.org/node/3161
>
> > -----Original Message-----
> > From: Dave Newton [mailto:newton.dave@(protected)]
> > Sent: Thursday, March 20, 2008 1:41 PM
> > To: Struts Users Mailing List
> > Subject: Re: Any issues using latest Dojo with Struts2?
> >
> > --- "Karr, David" <david.karr@(protected):
> > > Isn't it the case that Struts2 integrates Dojo, but a version older
> > > than the latest Dojo version?
> >
> > Yes.
> >
> > > Should I expect any difficulties if I try to use the latest
> > Dojo in a
> > > Struts2 application?
> >
> > Not if you're not trying to combine the two versions; you can
> > use "naked"
> > Dojo in an S2 app just like you would in any other framework.
> >
> > > I also see that Dojo uses "${...}" references for variable
> > substitution.
> > > Will that cause problems if this code is in a JSP?
> >
> > I'm not sure what you mean there; do you have a link to what
> > you're referring to?
> >
> > Dave
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_184516.ezm (zipped)
Attachment:
user_184517.ezm (zipped)Hello,
I want to assign a property to a value in jsp.
in struts 1.3 i could do it like:
<bean:define id="assign" name="somename" property="userName"
type="
java.lang.String" />
Now I can access the variable via: <%=assign%>
How can i accomplish this in struts2 for a property:
<s:property value="userName"/>
thanks
in advance.
Niels