You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steve Vanspall <st...@crmsoftware.com.au> on 2003/03/07 00:08:23 UTC

logic iterate with nested class (I think that's the term)

Hi there,

this  is my problem,

I hap a Map, namely a hashtable, that I want struts to iterate through,

Now the bean class of each entry in the map is
com.crm.util.TemplateBeans.IMGTemplateBean

where TemplateBeans is a class itself.

using the following tag

<logic:iterate name="RenderHTMLForm" id="imfFile"
type="com.crm.util.TemplateBeans.IMGTemplateBean" property="imageFields">

causes a ClassCastException, even though, I have checked and the object
class matches.

I then tried

<logic:iterate name="RenderHTMLForm" id="imfFile"
type="com.crm.util.TemplateBeans$IMGTemplateBean" property="imageFields">

this didn't work, I got a error stating that It was expecting a value of
class

com.crm.util.TemplateBeans.IMGTemplateBean but got one of type
java.lang.Object

If I can, I would like to keep these classes nested under
com.crm.util.TemplateBeans, just of eas of use and neatness. Is there a way
to properly reference these classes in the iterate tag??

Thaks in advance

Steve



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: redirecting to HTTPS

Posted by "Sterin, Ilya" <Is...@ciber.com>.
Great, thanks a bunch.

Ilya

-----Original Message-----
From: Max Cooper [mailto:max@maxcooper.com] 
Sent: Thursday, March 06, 2003 7:51 PM
To: Struts Users Mailing List
Subject: Re: redirecting to HTTPS


There are a number of issues involved that make it more complicated than
it should be (cookie domains, writing out all the links properly, etc.).
Fortunately, there is a project designed just for this purpose that
extends Struts to support relatively painless HTTP/HTTPS switching:
http://sslext.sourceforge.net

The main author of the extension has written a few articles about the
issues involved with such switching and what the extension does
specifically. Reading these would be a nice jump-start if you haven't
been through this kind of thing before:
http://www.javaworld.com/javaworld/jw-02-2002/jw-0215-ssl.html
http://www.javaworld.com/javaworld/jw-05-2002/jw-0510-struts.html

-Max

----- Original Message -----
From: "Sterin, Ilya" <Is...@ciber.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, March 06, 2003 4:16 PM
Subject: redirecting to HTTPS


> What's the easiest way to redirecting to https and back.  Meaning, 
> what's the I guess more common/prefered way of doing it in struts.
>
> Any small examples, would be great:-)
>
> Thanks a bunch.
>
> Ilya
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: redirecting to HTTPS

Posted by Max Cooper <ma...@maxcooper.com>.
There are a number of issues involved that make it more complicated than it
should be (cookie domains, writing out all the links properly, etc.).
Fortunately, there is a project designed just for this purpose that extends
Struts to support relatively painless HTTP/HTTPS switching:
http://sslext.sourceforge.net

The main author of the extension has written a few articles about the issues
involved with such switching and what the extension does specifically.
Reading these would be a nice jump-start if you haven't been through this
kind of thing before:
http://www.javaworld.com/javaworld/jw-02-2002/jw-0215-ssl.html
http://www.javaworld.com/javaworld/jw-05-2002/jw-0510-struts.html

-Max

----- Original Message -----
From: "Sterin, Ilya" <Is...@ciber.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, March 06, 2003 4:16 PM
Subject: redirecting to HTTPS


> What's the easiest way to redirecting to https and back.  Meaning,
> what's the I guess more common/prefered way of doing it in struts.
>
> Any small examples, would be great:-)
>
> Thanks a bunch.
>
> Ilya
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: redirecting to HTTPS

Posted by alexj <al...@freesurf.ch>.
It's came with it have a look of the web directory .

--
Alexandre Jaquet

----- Original Message ----- 
From: "Sterin, Ilya" <Is...@ciber.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, March 07, 2003 1:41 AM
Subject: RE: redirecting to HTTPS


> Ah, great, just found it, but I can't find any examples to go with it,
> nor a user's guide.  Any links? :-)
> 
> Ilya
> 
> -----Original Message-----
> From: alexj [mailto:alexj@freesurf.ch] 
> Sent: Thursday, March 06, 2003 7:37 PM
> To: Struts Users Mailing List
> Subject: Re: redirecting to HTTPS
> 
> 
> Have a look for SSLext. (you may find a sample
> with it)
> 
> --
> Alexandre Jaquet
> 
> ----- Original Message ----- 
> From: "Sterin, Ilya" <Is...@ciber.com>
> To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> Sent: Friday, March 07, 2003 1:16 AM
> Subject: redirecting to HTTPS
> 
> 
> > What's the easiest way to redirecting to https and back.  Meaning, 
> > what's the I guess more common/prefered way of doing it in struts.
> > 
> > Any small examples, would be great:-)
> > 
> > Thanks a bunch.
> > 
> > Ilya
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: redirecting to HTTPS

Posted by "Sterin, Ilya" <Is...@ciber.com>.
Ah, great, just found it, but I can't find any examples to go with it,
nor a user's guide.  Any links? :-)

Ilya

-----Original Message-----
From: alexj [mailto:alexj@freesurf.ch] 
Sent: Thursday, March 06, 2003 7:37 PM
To: Struts Users Mailing List
Subject: Re: redirecting to HTTPS


Have a look for SSLext. (you may find a sample
with it)

--
Alexandre Jaquet

----- Original Message ----- 
From: "Sterin, Ilya" <Is...@ciber.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, March 07, 2003 1:16 AM
Subject: redirecting to HTTPS


> What's the easiest way to redirecting to https and back.  Meaning, 
> what's the I guess more common/prefered way of doing it in struts.
> 
> Any small examples, would be great:-)
> 
> Thanks a bunch.
> 
> Ilya
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: redirecting to HTTPS

Posted by alexj <al...@freesurf.ch>.
Have a look for SSLext. (you may find a sample
with it)

--
Alexandre Jaquet

----- Original Message ----- 
From: "Sterin, Ilya" <Is...@ciber.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, March 07, 2003 1:16 AM
Subject: redirecting to HTTPS


> What's the easiest way to redirecting to https and back.  Meaning,
> what's the I guess more common/prefered way of doing it in struts.
> 
> Any small examples, would be great:-)
> 
> Thanks a bunch.
> 
> Ilya
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


redirecting to HTTPS

Posted by "Sterin, Ilya" <Is...@ciber.com>.
What's the easiest way to redirecting to https and back.  Meaning,
what's the I guess more common/prefered way of doing it in struts.

Any small examples, would be great:-)

Thanks a bunch.

Ilya

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: logic iterate with nested class (I think that's the term)

Posted by Steve Vanspall <st...@crmsoftware.com.au>.
Yeah, I am trying to make input tags out of them

Thanks anywa

Steve

-----Original Message-----
From: Rick Reumann [mailto:maillist@reumann.net]
Sent: Friday, 7 March 2003 10:54 AM
To: Struts Users Mailing List
Subject: Re: logic iterate with nested class (I think that's the term)


On Fri, 7 Mar 2003 10:31:08 +1100
"Steve Vanspall" <st...@crmsoftware.com.au> wrote:

> Ignore this one,
> 
> It seems that Struts doesn't know to go into the Hashtable entry and
> just get the value,

You can iterate through a map and display the keys and values just fine:

<logic:iterate id="element" name="someMapInScope">
    <bean:write name="element" property="key"/> - 
    <bean:write name="element" property="value"/><BR>
</logic:iterate>

Or better yet use JSTL tags:

<c:forEach var="element" items="${someMapInScope}">
    <c:out value="${element.key}"/> - 
    <c:out value="${element.value}"/><br>
</c:forEach>

 
-- 
Rick Reumann

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: logic iterate with nested class (I think that's the term)

Posted by Rick Reumann <ma...@reumann.net>.
On Fri, 7 Mar 2003 10:31:08 +1100
"Steve Vanspall" <st...@crmsoftware.com.au> wrote:

> Ignore this one,
> 
> It seems that Struts doesn't know to go into the Hashtable entry and
> just get the value,

You can iterate through a map and display the keys and values just fine:

<logic:iterate id="element" name="someMapInScope">
    <bean:write name="element" property="key"/> - 
    <bean:write name="element" property="value"/><BR>
</logic:iterate>

Or better yet use JSTL tags:

<c:forEach var="element" items="${someMapInScope}">
    <c:out value="${element.key}"/> - 
    <c:out value="${element.value}"/><br>
</c:forEach>

 
-- 
Rick Reumann

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: logic iterate with nested class (I think that's the term)

Posted by Steve Vanspall <st...@crmsoftware.com.au>.
Ignore this one,

It seems that Struts doesn't know to go into the Hashtable entry and just
get the value,

Very strange, but basically it was looking to cast the whole entry rather
than just the value.

Will have to convert it to use a list instead

STeve

-----Original Message-----
From: Steve Vanspall [mailto:steve@crmsoftware.com.au]
Sent: Friday, 7 March 2003 10:08 AM
To: Struts User Mailing List
Subject: logic iterate with nested class (I think that's the term)


Hi there,

this  is my problem,

I hap a Map, namely a hashtable, that I want struts to iterate through,

Now the bean class of each entry in the map is
com.crm.util.TemplateBeans.IMGTemplateBean

where TemplateBeans is a class itself.

using the following tag

<logic:iterate name="RenderHTMLForm" id="imfFile"
type="com.crm.util.TemplateBeans.IMGTemplateBean" property="imageFields">

causes a ClassCastException, even though, I have checked and the object
class matches.

I then tried

<logic:iterate name="RenderHTMLForm" id="imfFile"
type="com.crm.util.TemplateBeans$IMGTemplateBean" property="imageFields">

this didn't work, I got a error stating that It was expecting a value of
class

com.crm.util.TemplateBeans.IMGTemplateBean but got one of type
java.lang.Object

If I can, I would like to keep these classes nested under
com.crm.util.TemplateBeans, just of eas of use and neatness. Is there a way
to properly reference these classes in the iterate tag??

Thaks in advance

Steve



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org