Author Login
Post Reply
user Digest 10 Jul 2008 20:29:21 -0000 Issue 8135
Topics (messages 188720 through 188737):
REST plugin doesn't return JSON serialization anymore...
188720 by: John Moose
188722 by: Musachy Barroso
188724 by: John Moose
188727 by: Musachy Barroso
188728 by: Dave Newton
Re: looking for suggestion regarding interceptor
188721 by: Chris Pratt
188725 by: Gabriel Belingueres
188730 by: Chris Pratt
Action form bean values in javascript
188723 by: vimala
188726 by: Dave Newton
Re: Struts-Tiles - Missing Content
188729 by: Ryan Henson
[S1] div update and struts
188731 by: Lalchandra Rampersaud
Re: Struts1 and Struts2 mailing lists separation ?
188732 by: Laurie Harper
Integration Of Struts 2 and Acegi
188733 by: nani2ratna
188736 by: Owen Berry
Re: [S2]Integration Of Struts 2 and Acegi
188734 by: Miguel
188735 by: nani2ratna
Re: getting Session from one to another namespace - possible?
188737 by: Randy Burgess
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_188720.ezm (zipped)building with Struts-2.1.3-SNAPSHOT and xworks-2.1.2-SNAPSHOT
the XML extenson and XHTML extension seem to work OK both in the showcase
and my app, but the .json extension seems to be triggering a File Download
action...even in the showcase???
fwiw, JSON serialized data is a key feature of our new
architecture...several weeks back this feature worked well and our gov't
sponsors were really impressed.

Attachment:
user_188722.ezm (zipped)Could you open a jira ticket with the details?
musachy
On Thu, Jul 10, 2008 at 2:03 PM, John Moose <jgmoose@(protected):
> building with Struts-2.1.3-SNAPSHOT and xworks-2.1.2-SNAPSHOT
>
> the XML extenson and XHTML extension seem to work OK both in the showcase
> and my app, but the .json extension seems to be triggering a File Download
> action...even in the showcase???
>
> fwiw, JSON serialized data is a key feature of our new
> architecture...several weeks back this feature worked well and our gov't
> sponsors were really impressed.
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_188724.ezm (zipped)no problem, is this a Struts 2 issue or Struts sandbox issue??
On Thu, Jul 10, 2008 at 2:15 PM, Musachy Barroso <musachy@(protected):
> Could you open a jira ticket with the details?
>
> musachy
>
> On Thu, Jul 10, 2008 at 2:03 PM, John Moose <jgmoose@(protected):
> > building with Struts-2.1.3-SNAPSHOT and xworks-2.1.2-SNAPSHOT
> >
> > the XML extenson and XHTML extension seem to work OK both in the showcase
> > and my app, but the .json extension seems to be triggering a File
> Download
> > action...even in the showcase???
> >
> > fwiw, JSON serialized data is a key feature of our new
> > architecture...several weeks back this feature worked well and our gov't
> > sponsors were really impressed.
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188727.ezm (zipped)Struts 2
musachy
On Thu, Jul 10, 2008 at 2:26 PM, John Moose <jgmoose@(protected):
> no problem, is this a Struts 2 issue or Struts sandbox issue??
>
> On Thu, Jul 10, 2008 at 2:15 PM, Musachy Barroso <musachy@(protected):
>
>> Could you open a jira ticket with the details?
>>
>> musachy
>>
>> On Thu, Jul 10, 2008 at 2:03 PM, John Moose <jgmoose@(protected):
>> > building with Struts-2.1.3-SNAPSHOT and xworks-2.1.2-SNAPSHOT
>> >
>> > the XML extenson and XHTML extension seem to work OK both in the showcase
>> > and my app, but the .json extension seems to be triggering a File
>> Download
>> > action...even in the showcase???
>> >
>> > fwiw, JSON serialized data is a key feature of our new
>> > architecture...several weeks back this feature worked well and our gov't
>> > sponsors were really impressed.
>> >
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_188728.ezm (zipped)It's an S2 REST plugin issue...
--- On Thu, 7/10/08, John Moose <jgmoose@(protected):
> no problem, is this a Struts 2 issue or Struts sandbox
> issue??
>
> On Thu, Jul 10, 2008 at 2:15 PM, Musachy Barroso
> <musachy@(protected):
>
> > Could you open a jira ticket with the details?
> >
> > musachy
> >
> > On Thu, Jul 10, 2008 at 2:03 PM, John Moose
> <jgmoose@(protected):
> > > building with Struts-2.1.3-SNAPSHOT and
> xworks-2.1.2-SNAPSHOT
> > >
> > > the XML extenson and XHTML extension seem to work
> OK both in the showcase
> > > and my app, but the .json extension seems to be
> triggering a File
> > Download
> > > action...even in the showcase???
> > >
> > > fwiw, JSON serialized data is a key feature of
> our new
> > > architecture...several weeks back this feature
> worked well and our gov't
> > > sponsors were really impressed.
> > >
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the
> stone?" Pink Floyd
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> > For additional commands, e-mail:
> user-help@(protected)
> >
> >

Attachment:
user_188721.ezm (zipped)I guess I'm confused. If Spring is injecting the data, why do you
need it to also inject the Service?
(*Chris*)
On Thu, Jul 10, 2008 at 10:41 AM, Gabriel Belingueres
<belingueres@(protected):
> IMHO both approaches are similar, as the intention is to inject the
> required data when you need it. The difference is that you created
> both an interface and an interceptor to perform the injection, while I
> relied on Spring to do this work.
>
> As a general rule I think on writing custom interceptors only when
> there is some generic pre/post processing that would need to take on a
> set of actions but that are not part of regular functional
> requirements.
>
> See between the lines:
>
> 2008/7/10 Chris Pratt <thechrispratt@(protected)>:
>> But then your Service Bean/DAO has to be injected into every Action
>> that might need to load it
>
> Yes, in the same way you need to implement the xxxAware interface in
> every action that need to access the data.
>
>> and the code to check for the Data Object
>> and load it,
>
> Not quite; this is the job of Spring, I only declare it one time in
> the spring configuration xml file.
>
>>then store it to the context has to be Cut-n-Pasted
>
> Don't know what you meant here. There is not too much C&P. Just 2
> instance variables: one for the service, and the other for the data.
> Same as implementing the interface and declaring a variable to hold
> the data.
>
>> between each of those Actions. Way too many chances for Cut-n-Paste
>> errors or incomplete fixes for my taste. By using the Interceptor
>> that code is consolidated in one place and the only thing the Action
>> has to worry about it what it was created specifically to accomplish,
>> not all the other housekeeping chores.
>> (*Chris*)
>>
>> On Wed, Jul 9, 2008 at 6:10 PM, Gabriel Belingueres
>> <belingueres@(protected):
>>> Wow it is amazing how S2 can be used.
>>> This is a use of interceptor I've never seen before.
>>>
>>> IMHO, I think it is too much trouble to declare an xxxAware interface
>>> and an xxxInterceptor to just share the same database data across
>>> multiple pages. I would stick to store the data in session or
>>> application scope. You have available the SessionAware and
>>> ApplicationAware interfaces that injects into an action a
>>>
java.util.Map that usually is enough for testability.
>>>
>>> My own common solution to this problem would be to use Spring to
>>> inject a service bean into the action that would retrieve the category
>>> list from a cache (OSCache works great for me and has easy Spring
>>> integration.) When data is not in the cache or it times-out, it is
>>> read from the database.
>>>
>>> 2008/7/9 Chris Pratt <thechrispratt@(protected)>:
>>>> That's usually how I start. The one thing I usually add is an Aware
>>>> interface that allows me to inject the value into my Actions when it's
>>>> needed. So in your case I'd add a simple interface:
>>>>
>>>> interface CategoryListAware {
>>>> void setCategoryList(List<Category> categories);
>>>> }
>>>>
>>>> And at the end of your interceptor I'd add:
>>>>
>>>> Object action = invocation.getAction();
>>>> if(action instanceof CategoryListAware) {
>>>> ((CategoryListAware)action).setCategoryList(categoryList);
>>>> }
>>>>
>>>> That way you can add the Interceptor to your default stack and the
>>>> Actions that need the category list can have it injected without
>>>> having to have any knowledge about the Session. (which makes the
>>>> system much easier to unit test).
>>>>
>>>> (*Chris*)
>>>>
>>>> On Wed, Jul 9, 2008 at 3:28 PM, Dhiraj Thakur <desi.tek.org@(protected):
>>>>> Hello there,
>>>>>
>>>>> There are 4 jsp page in which i want to show same category by retrieving it
>>>>> from database.
>>>>> What is the best way to do that? should i write a intercepter which will
>>>>> retrieve Category from database and store it in session?
>>>>> something like this
>>>>>
>>>>>
>>>>> if (session.getAttribute("category") == null) {
>>>>>
>>>>> CategoryDAO categoryDAO = new CategoryDAO();
>>>>>
>>>>> categoryList = categoryDAO.listCategory();
>>>>>
>>>>> session.setAttribute(ConfigAPP.CATEGORY_KEY, categoryList);
>>>>>
>>>>> categoryList = (List)
>>>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>>>
>>>>> System.out.println(categoryList.size());
>>>>>
>>>>> } else {
>>>>> categoryList = categoryList = (List)
>>>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>>> }
>>>>>
>>>>>
>>>>> or is there any other way to do that ?
>>>>>
>>>>>
>>>>>
>>>>> *Dhiraj*
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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)
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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_188725.ezm (zipped)Spring only inject the service. The data returned by the service is
holded into an instance variable of the action (or I could just store
the data in session or application scope).
Spring dependencies are wired this way:
Service <--- Cache <--- DAO
Ex:
class MyAction extends ActionSupport {
private Service service; // with its setter
private List<Data> list; // with its setter and getter
public String execute() {
list = service.getData();
return SUCCESS;
}
}
2008/7/10 Chris Pratt <thechrispratt@(protected)>:
> I guess I'm confused. If Spring is injecting the data, why do you
> need it to also inject the Service?
> (*Chris*)
>
> On Thu, Jul 10, 2008 at 10:41 AM, Gabriel Belingueres
> <belingueres@(protected):
>> IMHO both approaches are similar, as the intention is to inject the
>> required data when you need it. The difference is that you created
>> both an interface and an interceptor to perform the injection, while I
>> relied on Spring to do this work.
>>
>> As a general rule I think on writing custom interceptors only when
>> there is some generic pre/post processing that would need to take on a
>> set of actions but that are not part of regular functional
>> requirements.
>>
>> See between the lines:
>>
>> 2008/7/10 Chris Pratt <thechrispratt@(protected)>:
>>> But then your Service Bean/DAO has to be injected into every Action
>>> that might need to load it
>>
>> Yes, in the same way you need to implement the xxxAware interface in
>> every action that need to access the data.
>>
>>> and the code to check for the Data Object
>>> and load it,
>>
>> Not quite; this is the job of Spring, I only declare it one time in
>> the spring configuration xml file.
>>
>>>then store it to the context has to be Cut-n-Pasted
>>
>> Don't know what you meant here. There is not too much C&P. Just 2
>> instance variables: one for the service, and the other for the data.
>> Same as implementing the interface and declaring a variable to hold
>> the data.
>>
>>> between each of those Actions. Way too many chances for Cut-n-Paste
>>> errors or incomplete fixes for my taste. By using the Interceptor
>>> that code is consolidated in one place and the only thing the Action
>>> has to worry about it what it was created specifically to accomplish,
>>> not all the other housekeeping chores.
>>> (*Chris*)
>>>
>>> On Wed, Jul 9, 2008 at 6:10 PM, Gabriel Belingueres
>>> <belingueres@(protected):
>>>> Wow it is amazing how S2 can be used.
>>>> This is a use of interceptor I've never seen before.
>>>>
>>>> IMHO, I think it is too much trouble to declare an xxxAware interface
>>>> and an xxxInterceptor to just share the same database data across
>>>> multiple pages. I would stick to store the data in session or
>>>> application scope. You have available the SessionAware and
>>>> ApplicationAware interfaces that injects into an action a
>>>>
java.util.Map that usually is enough for testability.
>>>>
>>>> My own common solution to this problem would be to use Spring to
>>>> inject a service bean into the action that would retrieve the category
>>>> list from a cache (OSCache works great for me and has easy Spring
>>>> integration.) When data is not in the cache or it times-out, it is
>>>> read from the database.
>>>>
>>>> 2008/7/9 Chris Pratt <thechrispratt@(protected)>:
>>>>> That's usually how I start. The one thing I usually add is an Aware
>>>>> interface that allows me to inject the value into my Actions when it's
>>>>> needed. So in your case I'd add a simple interface:
>>>>>
>>>>> interface CategoryListAware {
>>>>> void setCategoryList(List<Category> categories);
>>>>> }
>>>>>
>>>>> And at the end of your interceptor I'd add:
>>>>>
>>>>> Object action = invocation.getAction();
>>>>> if(action instanceof CategoryListAware) {
>>>>> ((CategoryListAware)action).setCategoryList(categoryList);
>>>>> }
>>>>>
>>>>> That way you can add the Interceptor to your default stack and the
>>>>> Actions that need the category list can have it injected without
>>>>> having to have any knowledge about the Session. (which makes the
>>>>> system much easier to unit test).
>>>>>
>>>>> (*Chris*)
>>>>>
>>>>> On Wed, Jul 9, 2008 at 3:28 PM, Dhiraj Thakur <desi.tek.org@(protected):
>>>>>> Hello there,
>>>>>>
>>>>>> There are 4 jsp page in which i want to show same category by retrieving it
>>>>>> from database.
>>>>>> What is the best way to do that? should i write a intercepter which will
>>>>>> retrieve Category from database and store it in session?
>>>>>> something like this
>>>>>>
>>>>>>
>>>>>> if (session.getAttribute("category") == null) {
>>>>>>
>>>>>> CategoryDAO categoryDAO = new CategoryDAO();
>>>>>>
>>>>>> categoryList = categoryDAO.listCategory();
>>>>>>
>>>>>> session.setAttribute(ConfigAPP.CATEGORY_KEY, categoryList);
>>>>>>
>>>>>> categoryList = (List)
>>>>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>>>>
>>>>>> System.out.println(categoryList.size());
>>>>>>
>>>>>> } else {
>>>>>> categoryList = categoryList = (List)
>>>>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>>>> }
>>>>>>
>>>>>>
>>>>>> or is there any other way to do that ?
>>>>>>
>>>>>>
>>>>>>
>>>>>> *Dhiraj*
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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)
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188730.ezm (zipped)Oh, I see. Since we have a need to cache much of our data between
requests (rather than fetching the data from the back end systems on
every action request), we have more code that would have to be copied
to each execute method (using your scheme). So in our case it
relieves a lot of headaches to have that code in one location. Thanks
for the explanation.
(*Chris*)
On Thu, Jul 10, 2008 at 11:28 AM, Gabriel Belingueres
<belingueres@(protected):
> Spring only inject the service. The data returned by the service is
> holded into an instance variable of the action (or I could just store
> the data in session or application scope).
>
> Spring dependencies are wired this way:
>
> Service <--- Cache <--- DAO
>
>
> Ex:
>
> class MyAction extends ActionSupport {
>
> private Service service; // with its setter
> private List<Data> list; // with its setter and getter
>
> public String execute() {
> list = service.getData();
> return SUCCESS;
> }
>
> }
>
>
> 2008/7/10 Chris Pratt <thechrispratt@(protected)>:
>> I guess I'm confused. If Spring is injecting the data, why do you
>> need it to also inject the Service?
>> (*Chris*)
>>
>> On Thu, Jul 10, 2008 at 10:41 AM, Gabriel Belingueres
>> <belingueres@(protected):
>>> IMHO both approaches are similar, as the intention is to inject the
>>> required data when you need it. The difference is that you created
>>> both an interface and an interceptor to perform the injection, while I
>>> relied on Spring to do this work.
>>>
>>> As a general rule I think on writing custom interceptors only when
>>> there is some generic pre/post processing that would need to take on a
>>> set of actions but that are not part of regular functional
>>> requirements.
>>>
>>> See between the lines:
>>>
>>> 2008/7/10 Chris Pratt <thechrispratt@(protected)>:
>>>> But then your Service Bean/DAO has to be injected into every Action
>>>> that might need to load it
>>>
>>> Yes, in the same way you need to implement the xxxAware interface in
>>> every action that need to access the data.
>>>
>>>> and the code to check for the Data Object
>>>> and load it,
>>>
>>> Not quite; this is the job of Spring, I only declare it one time in
>>> the spring configuration xml file.
>>>
>>>>then store it to the context has to be Cut-n-Pasted
>>>
>>> Don't know what you meant here. There is not too much C&P. Just 2
>>> instance variables: one for the service, and the other for the data.
>>> Same as implementing the interface and declaring a variable to hold
>>> the data.
>>>
>>>> between each of those Actions. Way too many chances for Cut-n-Paste
>>>> errors or incomplete fixes for my taste. By using the Interceptor
>>>> that code is consolidated in one place and the only thing the Action
>>>> has to worry about it what it was created specifically to accomplish,
>>>> not all the other housekeeping chores.
>>>> (*Chris*)
>>>>
>>>> On Wed, Jul 9, 2008 at 6:10 PM, Gabriel Belingueres
>>>> <belingueres@(protected):
>>>>> Wow it is amazing how S2 can be used.
>>>>> This is a use of interceptor I've never seen before.
>>>>>
>>>>> IMHO, I think it is too much trouble to declare an xxxAware interface
>>>>> and an xxxInterceptor to just share the same database data across
>>>>> multiple pages. I would stick to store the data in session or
>>>>> application scope. You have available the SessionAware and
>>>>> ApplicationAware interfaces that injects into an action a
>>>>>
java.util.Map that usually is enough for testability.
>>>>>
>>>>> My own common solution to this problem would be to use Spring to
>>>>> inject a service bean into the action that would retrieve the category
>>>>> list from a cache (OSCache works great for me and has easy Spring
>>>>> integration.) When data is not in the cache or it times-out, it is
>>>>> read from the database.
>>>>>
>>>>> 2008/7/9 Chris Pratt <thechrispratt@(protected)>:
>>>>>> That's usually how I start. The one thing I usually add is an Aware
>>>>>> interface that allows me to inject the value into my Actions when it's
>>>>>> needed. So in your case I'd add a simple interface:
>>>>>>
>>>>>> interface CategoryListAware {
>>>>>> void setCategoryList(List<Category> categories);
>>>>>> }
>>>>>>
>>>>>> And at the end of your interceptor I'd add:
>>>>>>
>>>>>> Object action = invocation.getAction();
>>>>>> if(action instanceof CategoryListAware) {
>>>>>> ((CategoryListAware)action).setCategoryList(categoryList);
>>>>>> }
>>>>>>
>>>>>> That way you can add the Interceptor to your default stack and the
>>>>>> Actions that need the category list can have it injected without
>>>>>> having to have any knowledge about the Session. (which makes the
>>>>>> system much easier to unit test).
>>>>>>
>>>>>> (*Chris*)
>>>>>>
>>>>>> On Wed, Jul 9, 2008 at 3:28 PM, Dhiraj Thakur <desi.tek.org@(protected):
>>>>>>> Hello there,
>>>>>>>
>>>>>>> There are 4 jsp page in which i want to show same category by retrieving it
>>>>>>> from database.
>>>>>>> What is the best way to do that? should i write a intercepter which will
>>>>>>> retrieve Category from database and store it in session?
>>>>>>> something like this
>>>>>>>
>>>>>>>
>>>>>>> if (session.getAttribute("category") == null) {
>>>>>>>
>>>>>>> CategoryDAO categoryDAO = new CategoryDAO();
>>>>>>>
>>>>>>> categoryList = categoryDAO.listCategory();
>>>>>>>
>>>>>>> session.setAttribute(ConfigAPP.CATEGORY_KEY, categoryList);
>>>>>>>
>>>>>>> categoryList = (List)
>>>>>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>>>>>
>>>>>>> System.out.println(categoryList.size());
>>>>>>>
>>>>>>> } else {
>>>>>>> categoryList = categoryList = (List)
>>>>>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> or is there any other way to do that ?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *Dhiraj*
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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)
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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)
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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_188723.ezm (zipped)
Hai all,
I am using struts for web application development. I have a class
clsDateTools within which I define a function public boolean isDate(String
dateToCheck) for validating date values. Here is my jsp page
<%@(protected)" %>
<html:html>
<script language="JavaScript">
<% clsDateTools datetool = new clsDateTools();%>
function Save(){
................................
................................
if(document.someActionForm.txtInspectionDate.value != ""){
valuefn = <% =isDate(document.someActionForm.txtInspectionDate.value) %>;
if(valueFn == false){
alert("Enter valid Complication Date in dd/mm/yyyy");
return false;
}
}
}
</script>
<body onload="onLoadFn()">
<html:form action="/someAction.do">
<table align="center" width="100%">
<tr>
......
</tr>
<tr>
<td align="right" width="50%">
<p class="normaltextualtheme">Inspection Date</p>
</td>
<td align="left" width="50%">
<script language='javascript'>
var datevalue =
"<%=request.getSession().getAttribute("txtInspectionDate")%>";
if(datevalue=="null") {
datevalue = "<%=datetool.stringnoDate("/")%>";
}
if (!document.layers) {
document.write("<input readonly='readonly' type=text
name=\"txtInspectionDate\" tabindex=\"2\" value=\""+datevalue+"\" size=10
class=\"readonly\" >");
document.write("<input type = button name=\"B3\" style=\"width: 20;
height: 20;background-image: url('./images/show-calendar.gif') \" value=\"\"
onclick='popUpCalendar(ttxtInspectionDate, txtInspectionDate,
\"dd/mm/yyyy\");return false;'>");
}
</script>
</td>
</tr>
</table>
</html:form>
</body>
</html:html>
For the code line valuefn = <%
=isDate(document.someActionForm.txtInspectionDate.value) %>,
it shows an error message 'document is unresolved type'. How can I pass the
action form values as parameters within javascript?
thanks
vimala
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188726.ezm (zipped)If you're doing validation in JavaScript anyway, why wouldn't you use a JavaScript-based date validation method and avoid the heinous mixing of Java and JavaScript?!
Dave
--- On Thu, 7/10/08, vimala <tharasp@(protected):
> I am using struts for web application development. I have a
> class
> clsDateTools within which I define a function public
> boolean isDate(String
> dateToCheck) for validating date values. Here is my jsp
> page
>
> <%@(protected)"
> %>
>
> <html:html>
>
> <script language="JavaScript">
>
> <% clsDateTools datetool = new clsDateTools();%>
>
> function Save(){
>
> ................................
> ................................
>
> if(document.someActionForm.txtInspectionDate.value !=
> ""){
> valuefn = <%
> =isDate(document.someActionForm.txtInspectionDate.value)
> %>;
>
> if(valueFn == false){
> alert("Enter valid Complication Date in
> dd/mm/yyyy");
> return false;
> }
> }
> }
>
> </script>
>
>
> <body onload="onLoadFn()">
> <html:form action="/someAction.do">
> <table align="center"
> width="100%">
> <tr>
> ......
> </tr>
>
> <tr>
> <td align="right"
> width="50%">
> <p
> class="normaltextualtheme">Inspection
> Date</p>
> </td>
> <td align="left"
> width="50%">
> <script language='javascript'>
>
> var datevalue =
> "<%=request.getSession().getAttribute("txtInspectionDate")%>";
> if(datevalue=="null") {
> datevalue =
> "<%=datetool.stringnoDate("/")%>";
> }
> if (!document.layers) {
> document.write("<input
> readonly='readonly' type=text
> name=\"txtInspectionDate\"
> tabindex=\"2\"
> value=\""+datevalue+"\" size=10
> class=\"readonly\" >");
> document.write("<input type = button
> name=\"B3\" style=\"width: 20;
> height: 20;background-image:
> url('./images/show-calendar.gif') \"
> value=\"\"
> onclick='popUpCalendar(ttxtInspectionDate,
> txtInspectionDate,
> \"dd/mm/yyyy\");return
> false;'>");
> }
> </script>
> </td>
> </tr>
> </table>
>
> </html:form>
> </body>
>
> </html:html>
>
> For the code line valuefn = <%
> =isDate(document.someActionForm.txtInspectionDate.value)
> %>,
> it shows an error message 'document is unresolved
> type'. How can I pass the
> action form values as parameters within javascript?

Attachment:
user_188729.ezm (zipped)SUCCESS! I figured out what was going wrong with my code. Whew, what a tangled mess.
I have a CustomRequestProcessor that initializes variables for users coming to the site and it was mucking up because part of my query includes values that come from that initialization. I had thought I had checked for this, but I was also getting an error that didn't actually report itself because I check the users cookies to see if they had cached their login for me.
Anyway, the problem is all in my own code and nothing funky with Struts/Tiles afterall.
Special Thanks to Antonio!!
----- Original Message ----
From: Ryan Henson <nwstraith@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Thursday, July 10, 2008 1:58:13 PM
Subject: Re: Struts-Tiles - Missing Content
I put in the text as you suggested and it did indeed show the text from the body. So now the issue has moved to being that the data variable is not being found. Alright, that helped me find some more issues but we're not quite there yet.
The results from the body come back with ONLY "Hello from the body". The logic beyond that should return either the data or the text "I do not see your data", but NEITHER is returned. I do not see any errors in the console to help me with this either. The logic tag simply does not do its job.
Ideas Antonio? Thanks for your help btw, I really do appreciate it.
Excerpt from ReportAction
________________________________
public ActionForward getCamperScheduleReport(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
logger.info("I'm starting my report");
DynaValidatorActionForm query = (DynaValidatorActionForm) form;
QueryService service = new QueryService();
ReportService service2 = new ReportService();
Camp camp = (Camp) request.getSession().getAttribute("currentCamp");
int currentCampID = camp.getCampID();
String[] camperIDs;
Report report = (Report) request.getAttribute("report");
if (query.getString("selectedIDs").indexOf(",") > 0) {
camperIDs = query.getString("selectedIDs").split(",");
} else {
camperIDs = new String[] { query.getString("selectedIDs") };
}
logger.info("I have the camper IDs which the first is: " + camperIDs[0]);
report.setSelectedIDs(query.getString("selectedIDs"));
request.setAttribute("report", report);
request.setAttribute("campers", service.getCampers(currentCampID));
request.setAttribute("periods", service.getPeriodList());
if (camperIDs[0].length() > 0) {
request.setAttribute("data", service2.getCamperScheduleReport(
camperIDs, currentCampID));
logger.info("I've set the data");
}
logger.info("All done what's next?");
if (query.getString("print").equals("true")) {
return mapping.findForward("camper.print");
} else {
return mapping.findForward("camper.view");
}
}
________________________________
Updated tools.report.camper.body.jsp
________________________________
<%@(protected)"%>
<%@(protected)"%>
<%@(protected)"%>
<%@(protected)"%>
Hello from the body
<logic:notPresent name="data">
I do not see your data
</logic:notPresent>
<logic:present name="data">
<logic:iterate name="data" id="person" indexId="num">
<logic:notEqual name="num" value="0">
<c:if test="${num % 3 == 0}">
<p class="pageBreak" />
</c:if>
</logic:notEqual>
<h3>${person.firstName} ${person.middleInitial} ${person.lastName}</h3>
<table class="sorted_list" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="100">
<table>
<tr>
<th>Age:</th>
<td>${person.age}</td>
</tr>
</table>
</td>
<td width="100">
<table>
<tr>
<th>Rank:</th>
<td>${person.rank}</td>
</tr>
</table>
</td>
<td width="100">
<table>
<tr>
<th>Troop:</th>
<td>${person.troopName}</td>
</tr>
</table>
</td>
</tr>
</table>
<logic:greaterThan name="person" property="classCount" value="0">
<table class="sorted_list" cellpadding="2" cellspacing="0" width="100%">
<tr>
<th>Period</th>
<th>ClassName</th>
<th>Instructor</th>
<th>Location</th>
<th>Area</th>
<th>Special Requirements</th>
</tr>
<logic:iterate name="periods" id="period">
<tr>
<td width="30">${period.periodName}</td>
<logic:iterate name="person" property="enrollment" id="course">
<logic:equal name="course" property="periodID"
value="${period.periodID}">
<td>${course.className}</td>
<td>${course.instructorFirstName} ${course.instructorLastName}</td>
<td>${course.locationName}</td>
<td>${course.areaName}</td>
<td>${course.specialRequirements}</td>
</logic:equal>
</logic:iterate>
</tr>
</logic:iterate>
</table>
</logic:greaterThan>
<logic:equal name="person" property="classCount" value="0">
The camper is not enrolled in any classes
</logic:equal>
</logic:iterate>
</logic:present>
________________________________
----- Original Message ----
From: Antonio Petrelli <antonio.petrelli@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Thursday, July 10, 2008 10:34:31 AM
Subject: Re: Struts-Tiles - Missing Content
2008/7/10 Ryan Henson <nwstraith@(protected)>:
> I posted the resulting HTML code at the bottom of that last email.
Whoops! Sorry I did not see it.
> It would appear from my side that the <tiles:insert attribute="body" /> is not executing properly as <tiles:getAsString name="title" /> does actually produce the correct text.
Now I see it, that's strange. I see that in your body JSP page there
is a <logic:present> tag surrounding everything. Can you try putting a
sample text before this tag to see if, at least, the page is called?
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_188731.ezm (zipped)
hi
i am using an iframe to update my page. i noticed
that the url does not change and my buttons have problems accessing javascript
functions that are supposed to be loaded along with the new data. the new
data is shown and i used firebug to check that my scripts are
loaded.
however if i put parent.document.location = parent.frames["hframe"].location
everything works perfectly but the page blinks (something i am trying to
avoid). could this be a problem with struts?
any help would be appreciated.
saludos
Lalchandra Rampersaud
------------
Carpe
diem

Attachment:
user_188732.ezm (zipped)You can always use Nabble:
http://www.nabble.com/Struts---User-f206.html
L.
Gabriel Belingueres wrote:
> I personally would like to interact using a web based forum where you
> can post with formatted java and xml code and even with emoticons
> instead of this email based mailing list, but this would be even more
> utopian....phpBB would do :)
>
> 2008/7/7 Jason Wyatt <jwyatt@(protected)>:
>> Dave, may I ask why it has been consistently voted down (and voted by who?). It would seem to be a logical separation IMHO, what's the benefit of keeping them together when the platforms have nothing in common except the name struts?
>>
>> If people still don't know about or use the [S1] and [S2] convention, which seems to be the case, its likely that won't change because new members will be joining the list all the time.
>>
>> +1 to split
>>
>> Regards
>> Jason
>>
>> -----Original Message-----
>> From: Dave Newton [mailto:newton.dave@(protected)]
>> Sent: Tuesday, 8 July 2008 2:40 AM
>> To: Struts Users Mailing List
>> Subject: Re: Struts1 and Struts2 mailing lists separation ?
>>
>> This has been brought up from time to time over the years and has been consistently voted down. (I suggested it once myself and am in favor of it as well.)
>>
>> In lieu of that happening I'd urge people to tag the subject line of all list messages with either [S1] or [S2] (or whatever, as long as it's adopted as an ad-hoc convention) and deal with it on the client side.
>>
>> Dave
>>
>> --- On Mon, 7/7/08, Chris Pratt <thechrispratt@(protected):
>>> Not that my vote counts, but +1 again.
>>>
>>> On Mon, Jul 7, 2008 at 6:40 AM, Owen Berry <owen.berry@(protected)>
>>> wrote:
>>>> And another, +1
>>>>
>>>> On Mon, Jul 7, 2008 at 8:28 AM, ManiKanta G
>>> <manikanta.gade@(protected):
>>>>> +1 me too
>>>>>
>>>>> Alessio Mereu wrote:
>>>>>> +1 for me too
>>>>>>
>>>>>> 2008/7/7 Marc Logemann
>>> <ml@(protected)>:
>>>>>>
>>>>>>> +1 for the suggestion
>>>>>>>
>>>>>>> Marc
>>>>>>>
>>>>>>> On Mon, 7 Jul 2008 12:53:14 +0200 (MEST),
>>> "MARCOSTOMSOBRAD@(protected)"
>>>>>>> <MARCOSTOMSOBRAD@(protected):
>>>>>>>
>>>>>>>> Could Struts project admins separate
>>> Struts1 and Struts2 users mailing
>>>>>>>> lists?
>>>>>>>> I think it is bad for the users to
>>> have two frameworks under the same
>>>>>>>> mailing list.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Ahora también puedes acceder a tu
>>> correo Terra desde el móvil.
>>>>>>>> Infórmate pinchando aquí.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>>> 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)
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>> ********** DISCLAIMER **********
>>>>> Information contained and transmitted by this
>>> E-MAIL is proprietary to Sify
>>>>> Limited and is intended for use only by the
>>> individual or entity to which it
>>>>> is addressed, and may contain information that is
>>> privileged, confidential
>>>>> or exempt from disclosure under applicable law. If
>>> this is a forwarded
>>>>> message, the content of this E-MAIL may not have
>>> been sent with the
>>>>> authority of the Company. If you are not the
>>> intended recipient, an agent of
>>>>> the intended recipient or a person responsible
>>> for delivering the
>>>>> information to the named recipient, you are
>>> notified that any use,
>>>>> distribution, transmission, printing, copying or
>>> dissemination of this
>>>>> information in any way or in any manner is
>>> strictly prohibited. If you have
>>>>> received this communication in error, please
>>> delete this mail & notify us
>>>>> immediately at admin@(protected)
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>>>> 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)
>>>>
>>> ---------------------------------------------------------------------
>>> 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)
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>

Attachment:
user_188733.ezm (zipped)
Hi,
can anybody tell me how to configure struts 2.0 and acegi,
I searched, but i got something in the javaworld for spring, struts 2 and
acegi.
Cant i implement with struts 2.1
If any body there who has already implemented this one.
If you dont mind please dont give any other links,
because i searched and i tried to implement every thing.
If i am wrong please guide me.
Thanks and Regards
Ratna sekhar.k
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188736.ezm (zipped)Note that Acegi has become Spring Security:
http://static.springframework.org/spring-security/site/index.html
On Thu, Jul 10, 2008 at 3:43 PM, nani2ratna <nani2ratna@(protected):
>
> Hi,
>
> can anybody tell me how to configure struts 2.0 and acegi,
> I searched, but i got something in the javaworld for spring, struts 2 and
> acegi.
> Cant i implement with struts 2.1
> If any body there who has already implemented this one.
> If you dont mind please dont give any other links,
> because i searched and i tried to implement every thing.
> If i am wrong please guide me.
>
> Thanks and Regards
> Ratna sekhar.k
> --
> View this message in context: http://www.nabble.com/Integration-Of-Struts-2-and-Acegi-tp18390390p18390390.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188734.ezm (zipped)The configuration is trivial if you only want to use the url
interceptor, using struts, o servlets or anything, and spring security
2.x.
If you need to use the acl's to restrict the callable method in the
struts action objects, theoretically it could be done, but i haven't
tried that.
I can send you an example, if you need
Si quieres ser más positivo, pierde un electrón
Miguel Ruiz Velasco S.
On Thu, Jul 10, 2008 at 2:43 PM, nani2ratna <nani2ratna@(protected):
>
> Hi,
>
> can anybody tell me how to configure struts 2.0 and acegi,
> I searched, but i got something in the javaworld for spring, struts 2 and
> acegi.
> Cant i implement with struts 2.1
> If any body there who has already implemented this one.
> If you dont mind please dont give any other links,
> because i searched and i tried to implement every thing.
> If i am wrong please guide me.
>
> Thanks and Regards
> Ratna sekhar.k
> --
> View this message in context: http://www.nabble.com/Integration-Of-Struts-2-and-Acegi-tp18390390p18390390.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188735.ezm (zipped)
Hi,
Thanks for immediate reply.
Please send me the example, my mail id is nani2ratna@(protected)
Which is the best one for authentication and authorization for
struts 2, spring, hibernate.
Please suggest me.
Thanks and Regards
Ratna Sekhar
Miguel-55 wrote:
>
> The configuration is trivial if you only want to use the url
> interceptor, using struts, o servlets or anything, and spring security
> 2.x.
> If you need to use the acl's to restrict the callable method in the
> struts action objects, theoretically it could be done, but i haven't
> tried that.
> I can send you an example, if you need
>
> Si quieres ser más positivo, pierde un electrón
> Miguel Ruiz Velasco S.
>
>
> On Thu, Jul 10, 2008 at 2:43 PM, nani2ratna <nani2ratna@(protected):
>>
>> Hi,
>>
>> can anybody tell me how to configure struts 2.0 and acegi,
>> I searched, but i got something in the javaworld for spring, struts 2 and
>> acegi.
>> Cant i implement with struts 2.1
>> If any body there who has already implemented this one.
>> If you dont mind please dont give any other links,
>> because i searched and i tried to implement every thing.
>> If i am wrong please guide me.
>>
>> Thanks and Regards
>> Ratna sekhar.k
>> --
>> View this message in context:
>> http://www.nabble.com/Integration-Of-Struts-2-and-Acegi-tp18390390p18390390.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188737.ezm (zipped)Is the namespace the same as what is defined in your struts.xml? Have you
tried namespace="/secure" for instance?
Regards,
Randy Burgess
Sr. Software Architect
D5 Systems, LLC
> From: Michael Obster <michael@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Thu, 10 Jul 2008 19:52:53 +0200
> To: Struts Users Mailing List <user@(protected)>
> Subject: getting Session from one to another namespace - possible?
>
> Hi,
>
> I've a problem with holding the session between two namespaces.
> I defined 3 namespaces:
> - /: The unsecure namespace
> - /secure: The secure namespace -> user has to be logged in
> - /usermanager: The special secure namespace -> user has to have
> permission to get there
>
> The LoginAction forwards the user into the secure namespace. There I
> have a menu with
> <a href="<s:url action="action1" namespace="secure"/>">link1</a>
> <a href="<s:url action="action2" namespace="secure"/>">link2</a>
> <a href="
> <s:url action="action3" namespace="usermanager"/>
> ">link3</a>
>
> When I switch to the action2 the session is hold. Switching back to
> action1 works as well.
> But if I switch to action3 I get the right page, but switching back to
> action1 or action2 I get the login page. After some debugging I've seen
> that the session was killed. After some further debugging I've seen that
> this only happens when I switch the namespace.
>
> Has anyone an idea, what I did wrong?
>
> Regards,
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>