Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 29 Jul 2008 19:04:19 -0000 Issue 8167

user-digest-help

2008-07-29


Author LoginPost Reply

user Digest 29 Jul 2008 19:04:19 -0000 Issue 8167

Topics (messages 189427 through 189439):

Re: s:include tag and s:param
 189427 by: Eric Nielsen

Re: <s:a dojo-anchor, usage of notifyTopics, impossible to get widget that invoked action
 189428 by: holod

Re: There is no Action mapped for namespace / and action name ...
 189429 by: John Moose

Re: Is this a wart on the framework?
 189430 by: stanlick

[S2] Testing if session variable is present
 189431 by: Milan Milanovic
 189432 by: Felipe Lorenz
 189434 by: Ylva D

S2 and Spring - exception mapping
 189433 by: Ramanathan RV

Possible to iterate through a java.util.Set using Struts 1?
 189435 by: Ylva D
 189436 by: Jim Kiley
 189437 by: Ylva D
 189438 by: Jim Kiley
 189439 by: Martin Gainty

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_189427.ezm (zipped)
So I tried the "param." access path last night. That wasn't working, the
documentation referenced a "parameters." instead. I managed to get that working
with s:component, but no luck with s:include.

I don't really care if I use component versus include; however I liked the
include slightly better since I was easily able to place my jsp
fragment/component underneath WEB-INF. When I tried using struts.ui.templateDir
to move the template directory used by s:component under WEB-INF, it appears to
break all the regular struts 2 tags. Is there a good way of locating
application custom templates underneath WEB-INF without breaking the search path
for the existing tag/themes?

Eric



Attachment: user_189428.ezm (zipped)

dojo.event.topic.subscribe("/afterDeleteLaw", function(data, request,
widget){
  //data : text returned from request(the html) It is my json
  //request: XMLHttpRequest object
  //widget: widget that published the topic
 var _mydata = eval("(" + data +")");
});

and:
                 <s:a id="idOfMyAnchor" showLoadingText="false"
targets="%{'linkattachedMainDocRow' + #document.count}"
                     theme="ajax" href="%{#deleteDocumentAction}"
notifyTopics="/afterDeleteLaw">
                    <s:url value= "/>
                 </s:a>
It is impossible to get id of widget. I've parsed object, it contains
fields connected with response, also it has field with data value (parameter
data).
Seems like it's useless to get id of widget that fired event.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189429.ezm (zipped)
re-ordered the libraries and builders, forced JDK compiler compliance to 5.0
( definitely *not* 6.0 !!) in Eclipse and voila...runs great. never
*really* thought it was a Struts2 problem ; )

On Tue, Jul 29, 2008 at 9:26 AM, John Moose <jgmoose@(protected):

> A very wierd situation...I have two projects in the Eclipse workspace --
> Tagging and Dashbd They both use the REST plugin and follow the naming
> conventions, etc. Tagging will build, re-deploy and run perfectly. When I
> close that project and open Dashbd, build, re-deploy and run I get the
> Action mapping failure as described. Both projects have source files in the
> "com.myeclipse.ozone" package name(space). Is it possible that there is some
> very persistent caching going on ??? like over multiple starts and re-starts
> of Tomcat? just a WAG...
>
> -John
>
>
> On Tue, Jul 29, 2008 at 5:08 AM, Pauli Savolainen <
> savolainen.pauli@(protected):
>
>> Hi,
>>
>> I am having exactly the same problem. I was using Struts 2.1.1,
>> switched to struts 2.1.2 (including the restful and codebehind
>> plugins) and started to get this 'no action found' error. I am quite
>> confident that I did not do anything that should've resulted in this.
>> Of course I cannot be 100% sure, because I did goof around with my
>> code a bit, but I checked and rechecked and rerechecked everthing
>> twice and couldn't find a reason for this behaviour.
>>
>> John's web.xml and the stacktrace are identical to mine. I don't
>> declare any namespaces in my struts.xml packages nor in the login form
>> from which I try to invoke the login action <s:form
>> action="/login/execute" method="post">. (Also tried with an
>> exclamation mark i.e. login!execute) I have a LoginAction.java with an
>> execute method in the pacakge defined in the web.xml's actionPackages
>> init parameter. At least this declaration used to send the control to
>> the LoginAction's execute method. Doesn't do anymore.
>>
>> I am using the struts 2.1.2 tiles plugin as well. On my index.jsp I
>> include a tiles main layout which in turn includes sub-layouts (such
>> as the login form). I don't know if this has anything got to do with
>> the problem I'm having.
>>
>> So, is a result of something I did wrong or could it be something else?
>>
>> Thank you
>>
>> Pauli Savolainen
>>
>> 2008/7/28 Paul Benedict <pbenedict@(protected)>:
>> > What's the correct way of writing a good 404 or action not found page?
>> Does
>> > s2 have something like a fallback action if nothing can be found?
>> >
>> > Paul
>> >
>> > On Mon, Jul 28, 2008 at 4:04 PM, Dave Newton <newton.dave@(protected)>
>> wrote:
>> >
>> >> Hmm, I wonder if it was the same issue I was having with 2.1.3 a week
>> or so
>> >> ago that I haven't had time to re-visit--so it actually could be the
>> web.xml
>> >> (specifically the dispatcher being used) and I may have put my foot in
>> my
>> >> mouth (again).
>> >>
>> >> Somebody followed up saying the original FilterDispatcher worked,
>> though,
>> >> so maybe not. Hrm.
>> >>
>> >> Dave
>> >>
>> >> --- On Mon, 7/28/08, John Moose <jgmoose@(protected):
>> >> > and I probably should have included this as well:
>> >> >
>> >> > Struts Problem Report
>> >> >
>> >> > Struts has detected an unhandled exception:
>> >> >  *Messages*:
>> >> > There is no Action mapped for namespace / and action name
>> >> > dashbd.
>> >> > ------------------------------
>> >> > Stacktraces *There is no Action mapped for namespace / and
>> >> > action name
>> >> > dashbd. - [unknown location]*
>> >> >
>> >> >
>> >> >
>> >>
>> com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:177)
>> >> >
>> >> >
>> >>
>> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy (DefaultActionProxyFactory.java:59)
>> >> >
>> >> >
>> >>
>> org.apache.struts2.rest.RestActionProxyFactory.createActionProxy(RestActionProxyFactory.java:40)
>> >> >
>> >> >
>> >>
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:439)
>> >> >
>> >> >
>> >>
>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:395)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:186)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:157)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:214)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardContextValve.invokeInternal (StandardContextValve.java:198)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:152)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:137)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:102)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104)
>> >> >
>> >> >
>> >>
>> org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520)
>> >> >
>> >> > org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:929)
>> >> >
>> >> >
>> org.apache.coyote.tomcat5.CoyoteAdapter.service (CoyoteAdapter.java:160)
>> >> >
>> >> >
>> >>
>> org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:799)
>> >> >
>> >> >
>> >>
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
>> >> >
>> >> >
>> >>
>> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
>> >> >
>> >> >
>> >>
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
>> >> >   java.lang.Thread.run (Thread.java:595)
>> >> >
>> >> >
>> >> >
>> >> > On Mon, Jul 28, 2008 at 4:39 PM, John Moose
>> >> > <jgmoose@(protected):
>> >> >
>> >> > > Hi Dave,
>> >> > >
>> >> > > I have the following snippet of DashbdController class
>> >> > that I am expecting
>> >> > > to hit with the following URL:
>> >> > >
>> >> > > http:/localhost:8080/Dashbd
>> >> > >
>> >> > > <---SNIPPET
>> >> > >
>> >> > > package com.myeclipse.ozone;
>> >> > >
>> >> > > import java.util.Collection;
>> >> > >
>> >> > > import com.myeclipse.hibernate.*;
>> >> > >
>> >> > > import org.hibernate.HibernateException;
>> >> > > import org.hibernate.Session;
>> >> > > import org.hibernate.cfg.Configuration;
>> >> > >
>> >> > > import org.apache.struts2.config.Result;
>> >> > > import org.apache.struts2.config.Results;
>> >> > > import
>> >> > org.apache.struts2.dispatcher.ServletActionRedirectResult;
>> >> > > import org.apache.struts2.rest.DefaultHttpHeaders;
>> >> > > import org.apache.struts2.rest.HttpHeaders;
>> >> > >
>> >> > > import com.opensymphony.xwork2.ModelDriven;
>> >> > > import com.opensymphony.xwork2.Validateable;
>> >> > > import com.opensymphony.xwork2.ValidationAwareSupport;
>> >> > >
>> >> > >
>> >> > > @Results({
>> >> > >   @Result(name="success",
>> >> > type=ServletActionRedirectResult.class,
>> >> > > value="dashbd")
>> >> > > })
>> >> > >
>> >> > > public class DashbdController extends
>> >> > ValidationAwareSupport implements
>> >> > > ModelDriven<Object>, Validateable{
>> >> > >
>> >> > >   //private static Gadget   transientGadget = new
>> >> > Gadget();
>> >> > >
>> >> > >   //String id;
>> >> > >   int id;
>> >> > >
>> >> > >   private static int   dashboardId;
>> >> > >
>> >> > >   private Collection<Dashbd>
>> >> > dashboardList;
>> >> > >   private Collection<Dashbd>   model;
>> >> > >   private Collection<DashbdType>
>> >> > dashboardTypeList;
>> >> > >
>> >> > >   private DashbdService dashboardService = new
>> >> > DashbdService(); // where
>> >> > > the DAOs live
>> >> > >
>> >> > >
>> >> > >   /*
>> >> > >
>> >> >
>> >>
>> ****************************************************************************************
>> >> > >    *         DASHBOARDS
>> >> > >    */
>> >> > >
>> >> > >   //
>> >> > >   // GET .../dashbd           get all
>> >> > dashboards in table
>> >> > >   //
>> >> > >   public HttpHeaders index() {
>> >> > >      dashboardList = dashboardService.getAll();
>> >> > >      return new
>> >> > DefaultHttpHeaders("index")  // dashbd-index.jsp
>> >> > >         .disableCaching();
>> >> > >   }
>> >> > >
>> >> > >
>> >> > > and etc. ....
>> >> > >
>> >> > > ...END SNIPPET >
>> >> > >
>> >> > > There are more methods in this calss of course, but
>> >> > all I'm trying to do
>> >> > > initially is hit the index() action with the URL above
>> >> > ?!?
>> >> > >
>> >> > > the index.jsp is really simple:
>> >> > >
>> >> > > <% response.sendRedirect("dashbd"); %>
>> >> > >
>> >> > >
>> >> > > this same scheme works perfectly with another RESTful
>> >> > app service and fir
>> >> > > the life of me, I can't find any
>> >> > >
>> >> > >
>> >> > >
>> >> > > On Mon, Jul 28, 2008 at 4:17 PM, Dave Newton
>> >> > <newton.dave@(protected):
>> >> > >
>> >> > >> The web.xml doesn't have anything to do with
>> >> > the error message; it thinks
>> >> > >> there isn't an action configured at the URL
>> >> > you're requesting.
>> >> > >>
>> >> > >> Impossible to help without more information.
>> >> > >>
>> >> > >> Dave
>> >> > >>
>> >> > >> --- On Mon, 7/28/08, John Moose
>> >> > <jgmoose@(protected):
>> >> > >>
>> >> > >> > From: John Moose <jgmoose@(protected)>
>> >> > >> > Subject: There is no Action mapped for
>> >> > namespace / and action name ...
>> >> > >> > To: "Struts Users Mailing List"
>> >> > <user@(protected)>
>> >> > >> > Date: Monday, July 28, 2008, 3:58 PM
>> >> > >> > I know what you're thinking... web.xml
>> >> > has no action
>> >> > >> > mapping, but it does!
>> >> > >> >
>> >> > >> >
>> >> > >> > <?xml version="1.0"
>> >> > >> > encoding="UTF-8"?>
>> >> > >> > <web-app version="2.5"
>> >> > >> >
>> >> > xmlns="http://java.sun.com/xml/ns/javaee"
>> >> > >> >
>> >> > >> >
>> >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> >> > >> >
>> >> > >> >
>> >> > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>> >> > >> >
>> >> > >> >
>> >> > http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
>> >> > >> >
>> >> > >> >   <display-name>Struts 2 RESTful
>> >> > Ozone
>> >> > >> > Services</display-name>
>> >> > >> >
>> >> > >> >  <!-- Filters -->
>> >> > >> >     <filter>
>> >> > >> >
>> >> > <filter-name>action2</filter-name>
>> >> > >> >
>> >> > >> >
>> >> > >>
>> >> >
>> >>
>> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>> >> > >> >       <init-param>
>> >> > >> >
>> >> > >> >
>> >> > <param-name>actionPackages</param-name>
>> >> > >> >
>> >> > >> >
>> >> > <param-value>com.myeclipse.ozone</param-value>
>> >> > >> >       </init-param>
>> >> > >> >       <init-param>
>> >> > >> >
>> >> > >> >
>> >> > <param-name>struts.devMode</param-name>
>> >> > >> >
>> >> > <param-value>true</param-value>
>> >> > >> >       </init-param>
>> >> > >> >     </filter>
>> >> > >> >
>> >> > >> >     <filter-mapping>
>> >> > >> >
>> >> > <filter-name>action2</filter-name>
>> >> > >> >
>> >> > <url-pattern>/*</url-pattern>
>> >> > >> >     </filter-mapping>
>> >> > >> >
>> >> > >> >  <welcome-file-list>
>> >> > >> >
>> >> > <welcome-file>index.jsp</welcome-file>
>> >> > >> >  </welcome-file-list>
>> >> > >> > </web-app>
>> >> > >> >
>> >> > >> >
>> >> > >> >
>> >> > >> > This file works well with another Struts2.1.3
>> >> > app. Can
>> >> > >> > someone help me
>> >> > >> > understand where to look for the cause of
>> >> > this???
>> >> > >> >
>> >> > >> > Thanks folks
>> >> > >>
>> >> > >>
>> >> > ---------------------------------------------------------------------
>> >> > >> 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_189430.ezm (zipped)

That is good news! When presented with a new framework to consider, easily
being able to present a dynamic web page is sort of a big deal.:rules: If
you look across the attributes/docs on the struts tags you find the primary
attributes key, name and id are sprinkled around placing the developer at
the mercy of trial and error. I seriously wonder if the best bet would be
to delete any struts custom tag that overlaps with JSTL and keep only those
integral to the framework itself. The StrutsRequestWrapper is already
making OGNL "JSTL friendly" and most of the time consuming riffraff has to
do with the bloody web page!

Look at how Struts Classic custom tags overlapped JSTL and all the confusion
that caused!

Peace,
Scott



Musachy Barroso wrote:
>
> We have been trying to remove unused params from the tags, and make
> them consistent (like adding a 'var' attribute to 'url' tag, and
> deprecating 'id'), in this case, the 'id' attribute should be removed.
> All it takes is to add an annotation to the tag class.
>
> musachy
>
> On Tue, Jul 29, 2008 at 8:43 AM, stanlick <stanlick@(protected):
>>
>> I have been away from Struts 2 for many months and was prompted with this
>> question yesterday:
>>
>> Why does this code throw a null pointer exception?
>>
>> <s:url action="employeeAction_subsetByDepartment">
>>   <s:param id="department" value="%{#attr.currRow.department}"/>
>> </s:url>
>>
>> After jacking around with it for nearly an hour I realized that id should
>> be
>> name! It seems the adjoining tags were using the id attribute and this
>> developer had applied common sense and used id here as well. Now I
>> realize
>> the JSTL/OGNL debate has caused much consternation among developers and I
>> have sort of gotten over that whole mess. But this tipped my scale!
>> What
>> gives with the Struts 2 tag library? Seriously, step outside yourself
>> and
>> think about it before you answer. Is this a wart on the framework?
>>
>> Peace,
>> Scott
>> --
>> View this message in context:
>> http://www.nabble.com/Is-this-a-wart-on-the-framework--tp18711301p18711301.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)
>>
>>
>
>
>
> --
> "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)
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189431.ezm (zipped)

Hi,

I need to test in jsp if some session variable is present, and based on that
to
show some struts view code or not. How can I do that ?

--
Thx, Milan
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189432.ezm (zipped)
Hummm.. Struts 1 or 2?

This code is to S2.

<s:if test="%{#session.your_variable != null}">

  do something

</s:if>

I didnt test it, so im not sure about the code.

But try it, and tell us.

Felipe Lorenz

On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
<milanmilanovich@(protected):

>
> Hi,
>
> I need to test in jsp if some session variable is present, and based on
> that
> to
> show some struts view code or not. How can I do that ?
>
> --
> Thx, Milan
> --
> View this message in context:
> http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.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_189434.ezm (zipped)

Hi Milan,

If you're using Struts 1 you should be able to use the logic:present tag
like this:
<logic:present name = "NameOfVariableSavedInSession" scope = "session">
 <tags to execute if the above is true....
</logic:present>

Hope this helps!

/Ylva


Milan Milanovic wrote:
>
> Hi,
>
> I need to test in jsp if some session variable is present, and based on
> that to
> show some struts view code or not. How can I do that ?
>
> --
> Thx, Milan
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189433.ezm (zipped)
Hello,

As per spring documentation, it is said that whenever an exception occurs,
spring framework would eventually rollback transaction, if any active is
present. I am using spring in combination with S2 and I do map all the
exceptions taking the user to error page. I am just wondering if when
working with the combination, the transactions are rolled back upon
occurance of exception.

--
Thanks
Ram

Attachment: user_189435.ezm (zipped)

Hi everyone!

I've just started learning Struts (1) and this is my current problem:
I have a java.util.Set which is saved in the current session and I'm trying
to use Struts for checking if it's not empty and in that case iterating
through it (from a JSP). This is the beginning of that code:

<logic:notEmpty scope = "session" name = "skillsFound">
       <logic:iterate collection = "skillsFound" id= "thisSkill" scope
= "session">  

When I try stepping through the code, the logic:notEmpty tag is handled just
fine, but when I get to the logic:iterate tag I get this exception:

javax.servlet.jsp.JspException: Cannot create iterator for this collection

Does anyone know if it's possible to iterate through a Set using Struts (1
and not 2) in any way?

I could always make it work by writing a scriptlet and iterate through it
the regular Java way, but I'm trying to use as much Struts as possible since
I'm doing a thesis where one of the issues is what the benefits of Struts
are. (And besides, I've read that using scriptlets is "bad style" nowadays.)

So if anybody knows a Struts solution to this, I'd be very grateful!

Thanks in advance!

/Ylva
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189436.ezm (zipped)
Any reason you can't transform the Set into a List at the back end, and then
iterate over the List?

jk

On Tue, Jul 29, 2008 at 2:16 PM, Ylva D <ylva.degerfeldt@(protected):

>
> Hi everyone!
>
> I've just started learning Struts (1) and this is my current problem:
> I have a java.util.Set which is saved in the current session and I'm trying
> to use Struts for checking if it's not empty and in that case iterating
> through it (from a JSP). This is the beginning of that code:
>
> <logic:notEmpty scope = "session" name = "skillsFound">
>        <logic:iterate collection = "skillsFound" id= "thisSkill" scope
> = "session">
>
> When I try stepping through the code, the logic:notEmpty tag is handled
> just
> fine, but when I get to the logic:iterate tag I get this exception:
>
> javax.servlet.jsp.JspException: Cannot create iterator for this collection
>
> Does anyone know if it's possible to iterate through a Set using Struts (1
> and not 2) in any way?
>
> I could always make it work by writing a scriptlet and iterate through it
> the regular Java way, but I'm trying to use as much Struts as possible
> since
> I'm doing a thesis where one of the issues is what the benefits of Struts
> are. (And besides, I've read that using scriptlets is "bad style"
> nowadays.)
>
> So if anybody knows a Struts solution to this, I'd be very grateful!
>
> Thanks in advance!
>
> /Ylva
> --
> View this message in context:
> http://www.nabble.com/Possible-to-iterate-through-a-java.util.Set-using-Struts-1--tp18718294p18718294.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)
>
>


--
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Attachment: user_189437.ezm (zipped)

Yes, I suppose I could do that but then I consider that a drawback of Struts.
Is there no other way?
If there isn't, I think I'd rather use a scriptlet no matter how bad it
looks.. (It's also because I'm doing this "Struts project" like a new
version of a project where I didn't use Struts and in that project I didn't
have to transform my Sets.)

/Ylva


Jim Kiley wrote:
>
> Any reason you can't transform the Set into a List at the back end, and
> then
> iterate over the List?
>
> jk
>
> On Tue, Jul 29, 2008 at 2:16 PM, Ylva D <ylva.degerfeldt@(protected):
>
>>
>> Hi everyone!
>>
>> I've just started learning Struts (1) and this is my current problem:
>> I have a java.util.Set which is saved in the current session and I'm
>> trying
>> to use Struts for checking if it's not empty and in that case iterating
>> through it (from a JSP). This is the beginning of that code:
>>
>> <logic:notEmpty scope = "session" name = "skillsFound">
>>        <logic:iterate collection = "skillsFound" id= "thisSkill"
>> scope
>> = "session">
>>
>> When I try stepping through the code, the logic:notEmpty tag is handled
>> just
>> fine, but when I get to the logic:iterate tag I get this exception:
>>
>> javax.servlet.jsp.JspException: Cannot create iterator for this
>> collection
>>
>> Does anyone know if it's possible to iterate through a Set using Struts
>> (1
>> and not 2) in any way?
>>
>> I could always make it work by writing a scriptlet and iterate through it
>> the regular Java way, but I'm trying to use as much Struts as possible
>> since
>> I'm doing a thesis where one of the issues is what the benefits of Struts
>> are. (And besides, I've read that using scriptlets is "bad style"
>> nowadays.)
>>
>> So if anybody knows a Struts solution to this, I'd be very grateful!
>>
>> Thanks in advance!
>>
>> /Ylva
>> --
>> View this message in context:
>> http://www.nabble.com/Possible-to-iterate-through-a-java.util.Set-using-Struts-1--tp18718294p18718294.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)
>>
>>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189438.ezm (zipped)
If this is new development, I don't understand why you would deliberately
choose Struts 1 over Struts 2. Unless your goal is to prove that Struts has
too many drawbacks to use.

jk

On Tue, Jul 29, 2008 at 2:50 PM, Ylva D <ylva.degerfeldt@(protected):

>
> Yes, I suppose I could do that but then I consider that a drawback of
> Struts.
> Is there no other way?
> If there isn't, I think I'd rather use a scriptlet no matter how bad it
> looks.. (It's also because I'm doing this "Struts project" like a new
> version of a project where I didn't use Struts and in that project I didn't
> have to transform my Sets.)
>
> /Ylva
>
>
> Jim Kiley wrote:
> >
> > Any reason you can't transform the Set into a List at the back end, and
> > then
> > iterate over the List?
> >
> > jk
> >
> > On Tue, Jul 29, 2008 at 2:16 PM, Ylva D <ylva.degerfeldt@(protected)>
> wrote:
> >
> >>
> >> Hi everyone!
> >>
> >> I've just started learning Struts (1) and this is my current problem:
> >> I have a java.util.Set which is saved in the current session and I'm
> >> trying
> >> to use Struts for checking if it's not empty and in that case iterating
> >> through it (from a JSP). This is the beginning of that code:
> >>
> >> <logic:notEmpty scope = "session" name = "skillsFound">
> >>        <logic:iterate collection = "skillsFound" id= "thisSkill"
> >> scope
> >> = "session">
> >>
> >> When I try stepping through the code, the logic:notEmpty tag is handled
> >> just
> >> fine, but when I get to the logic:iterate tag I get this exception:
> >>
> >> javax.servlet.jsp.JspException: Cannot create iterator for this
> >> collection
> >>
> >> Does anyone know if it's possible to iterate through a Set using Struts
> >> (1
> >> and not 2) in any way?
> >>
> >> I could always make it work by writing a scriptlet and iterate through
> it
> >> the regular Java way, but I'm trying to use as much Struts as possible
> >> since
> >> I'm doing a thesis where one of the issues is what the benefits of
> Struts
> >> are. (And besides, I've read that using scriptlets is "bad style"
> >> nowadays.)
> >>
> >> So if anybody knows a Struts solution to this, I'd be very grateful!
> >>
> >> Thanks in advance!
> >>
> >> /Ylva
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Possible-to-iterate-through-a-java.util.Set-using-Struts-1--tp18718294p18718294.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)
> >>
> >>
> >
> >
> > --
> > Jim Kiley
> > Technical Consultant | Summa
> > [p] 412.258.3346 [m] 412.445.1729
> > http://www.summa-tech.com
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Possible-to-iterate-through-a-java.util.Set-using-Struts-1--tp18718294p18718883.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)
>
>


--
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Attachment: user_189439.ezm (zipped)

If you want to go that way but
Set extends Collection
http://publib.boulder.ibm.com/infocenter/wsadhelp/v5r1m2/index.jsp?topic=/com.sun.api.doc/java/util/Set.html

Collection supports iterator() method which returns an iterator()
Iterator iterator()which you can use to iterate thru the collection
Iterator iterator = MySet.iterator()

http://publib.boulder.ibm.com/infocenter/wsadhelp/v5r1m2/index.jsp?topic=/com.sun.api.doc/java/util/Set.html
e.g.
while (iterator.hasNext())
{
Object obj = iterator.next();
}

?
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.


> Date: Tue, 29 Jul 2008 11:50:53 -0700
> From: ylva.degerfeldt@(protected)
> To: user@(protected)
> Subject: Re: Possible to iterate through a java.util.Set using Struts 1?
>
>
> Yes, I suppose I could do that but then I consider that a drawback of Struts.
> Is there no other way?
> If there isn't, I think I'd rather use a scriptlet no matter how bad it
> looks.. (It's also because I'm doing this "Struts project" like a new
> version of a project where I didn't use Struts and in that project I didn't
> have to transform my Sets.)
>
> /Ylva
>
>
> Jim Kiley wrote:
> >
> > Any reason you can't transform the Set into a List at the back end, and
> > then
> > iterate over the List?
> >
> > jk
> >
> > On Tue, Jul 29, 2008 at 2:16 PM, Ylva D <ylva.degerfeldt@(protected):
> >
> >>
> >> Hi everyone!
> >>
> >> I've just started learning Struts (1) and this is my current problem:
> >> I have a java.util.Set which is saved in the current session and I'm
> >> trying
> >> to use Struts for checking if it's not empty and in that case iterating
> >> through it (from a JSP). This is the beginning of that code:
> >>
> >> <logic:notEmpty scope = "session" name = "skillsFound">
> >>        <logic:iterate collection = "skillsFound" id= "thisSkill"
> >> scope
> >> = "session">
> >>
> >> When I try stepping through the code, the logic:notEmpty tag is handled
> >> just
> >> fine, but when I get to the logic:iterate tag I get this exception:
> >>
> >> javax.servlet.jsp.JspException: Cannot create iterator for this
> >> collection
> >>
> >> Does anyone know if it's possible to iterate through a Set using Struts
> >> (1
> >> and not 2) in any way?
> >>
> >> I could always make it work by writing a scriptlet and iterate through it
> >> the regular Java way, but I'm trying to use as much Struts as possible
> >> since
> >> I'm doing a thesis where one of the issues is what the benefits of Struts
> >> are. (And besides, I've read that using scriptlets is "bad style"
> >> nowadays.)
> >>
> >> So if anybody knows a Struts solution to this, I'd be very grateful!
> >>
> >> Thanks in advance!
> >>
> >> /Ylva
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Possible-to-iterate-through-a-java.util.Set-using-Struts-1--tp18718294p18718294.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)
> >>
> >>
> >
> >
> > --
> > Jim Kiley
> > Technical Consultant | Summa
> > [p] 412.258.3346 [m] 412.445.1729
> > http://www.summa-tech.com
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Possible-to-iterate-through-a-java.util.Set-using-Struts-1--tp18718294p18718883.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)
>

_________________________________________________________________
Keep your kids safer online with Windows Live Family Safety.
http://www.windowslive.com/family_safety/overview.html?ocid=TXT_TAGLM_WL_family_safety_072008
©2008 gg3721.com - Jax Systems, LLC, U.S.A.