Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Wes Wannemacher
Have you tried to use a struts2 tag with OGNL? If I am understanding
correctly, you could use -

@s.property value="@[EMAIL PROTECTED]('OGNL.pathTo.variable')

Of course, I don't know freemarker, and this is assuming you can reach
the variable from OGNL.

-W

On 11/9/07, Scott Kingdon <[EMAIL PROTECTED]> wrote:
> I am very used to using JSP taglibs and el functions for formatting
> text. In my current application I am using Struts2 with Freemarker as
> the templating engine. I need to format a phone number that is pulled
> from the database as 88 to be (888)888-. Using el
> functions you can just call a static method from some class. This
> would be nice since I already have that static method and it is used
> elsewhere in the app.
>
> I would use JSP for this, but our template is already built in
> Freemarker. There are also come JSP pages that use this phone
> formatter as well. Actually I have already created the el function tag
> and have been using it all over in the app.
>
> I have tried several things including trying to use el functions in
> freemarker or even including JSP pages from freemarker.
>
> Any ideas how this is done in the Struts2/Freemarker world? I am open
> to any idea.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

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



Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Dave Newton
--- Scott Kingdon <[EMAIL PROTECTED]> wrote:
> Thank you for that. That was a huge step in the
> right direction. However, that does not work.

*lol* Huge step off a short pier--I'm good at those.

Hmm, yeah, I didn't know about the lack of JSP tag
file support, but that's a good one to keep a handle
on, so thanks for the extra pursuit :)

On my list to add to the wiki.

d.


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



Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Scott Kingdon
Thank you for that. That was a huge step in the right direction.
However, that does not work.

freemarker.core.InvalidReferenceException: on line 4, column 146 in
template/xhtml/components/loginlink.ftl unitag.phone not found.


I found a snipped over on Freemarker's forum that says Freemarker does
not support some JSP 2.0 features. Bummer. That means this will
probably work if I just write a taglib instead. Or I have to wait
until they realease 2.3.11. Currently they are on 2.3.10...

https://sourceforge.net/forum/message.php?msg_id=4587560

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



Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Dave Newton
http://struts.apache.org/2.x/docs/freemarker.html

Towards the bottom.

--- Scott Kingdon <[EMAIL PROTECTED]> wrote:

> If that works that would be great. I tried it, but
> maybe I am doing
> something wrong.
> 
> In the JSP world, in order to use an el function you
> need to declair
> it at the top of the page like this:
> 
> <%@ taglib prefix="uni" uri="UniFunctions" %>
> 
> When I put this at the top of a Freemarker page, it
> just gets printed
> out to the page as text. So that does not work.
> 
> I tried declaring it in the JSP page before the
> freemarker template is
> called. Then I called the el function like this in
> my template.ftl:
> 
> ${uni:phone(session.USER.customer.phone)}
> 
> This spews out a nasty error. Freemarker complains
> that it does not
> know what to do with uni:phone.
> 
>
===
> 
> On Nov 9, 2007 4:08 PM, Dave Newton
> <[EMAIL PROTECTED]> wrote:
> > Since you can use any S2 tag inside a FreeMarker
> > template I guess I had assumed you could use the
> same
> > syntax to call static methods you can from JSP,
> does
> > that not work?
> >
> > (AFAIK you can also expose the JSTL library to a
> > FreeMarker page but I'm not sure how the two ELs
> would
> > play together; w/ OGNL you can use the %{...} EL
> > escape.)
> >
> > d.
> >
> >
> > --- Scott Kingdon <[EMAIL PROTECTED]> wrote:
> >
> > > I am very used to using JSP taglibs and el
> functions
> > > for formatting
> > > text. In my current application I am using
> Struts2
> > > with Freemarker as
> > > the templating engine. I need to format a phone
> > > number that is pulled
> > > from the database as 88 to be
> (888)888-.
> > > Using el
> > > functions you can just call a static method from
> > > some class. This
> > > would be nice since I already have that static
> > > method and it is used
> > > elsewhere in the app.
> > >
> > > I would use JSP for this, but our template is
> > > already built in
> > > Freemarker. There are also come JSP pages that
> use
> > > this phone
> > > formatter as well. Actually I have already
> created
> > > the el function tag
> > > and have been using it all over in the app.
> > >
> > > I have tried several things including trying to
> use
> > > el functions in
> > > freemarker or even including JSP pages from
> > > freemarker.
> > >
> > > Any ideas how this is done in the
> Struts2/Freemarker
> > > world? I am open
> > > to any idea.
> > >
> > >
> >
>
-
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> >
> >
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


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



Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Scott Kingdon
If that works that would be great. I tried it, but maybe I am doing
something wrong.

In the JSP world, in order to use an el function you need to declair
it at the top of the page like this:

<%@ taglib prefix="uni" uri="UniFunctions" %>

When I put this at the top of a Freemarker page, it just gets printed
out to the page as text. So that does not work.

I tried declaring it in the JSP page before the freemarker template is
called. Then I called the el function like this in my template.ftl:

${uni:phone(session.USER.customer.phone)}

This spews out a nasty error. Freemarker complains that it does not
know what to do with uni:phone.

===

On Nov 9, 2007 4:08 PM, Dave Newton <[EMAIL PROTECTED]> wrote:
> Since you can use any S2 tag inside a FreeMarker
> template I guess I had assumed you could use the same
> syntax to call static methods you can from JSP, does
> that not work?
>
> (AFAIK you can also expose the JSTL library to a
> FreeMarker page but I'm not sure how the two ELs would
> play together; w/ OGNL you can use the %{...} EL
> escape.)
>
> d.
>
>
> --- Scott Kingdon <[EMAIL PROTECTED]> wrote:
>
> > I am very used to using JSP taglibs and el functions
> > for formatting
> > text. In my current application I am using Struts2
> > with Freemarker as
> > the templating engine. I need to format a phone
> > number that is pulled
> > from the database as 88 to be (888)888-.
> > Using el
> > functions you can just call a static method from
> > some class. This
> > would be nice since I already have that static
> > method and it is used
> > elsewhere in the app.
> >
> > I would use JSP for this, but our template is
> > already built in
> > Freemarker. There are also come JSP pages that use
> > this phone
> > formatter as well. Actually I have already created
> > the el function tag
> > and have been using it all over in the app.
> >
> > I have tried several things including trying to use
> > el functions in
> > freemarker or even including JSP pages from
> > freemarker.
> >
> > Any ideas how this is done in the Struts2/Freemarker
> > world? I am open
> > to any idea.
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Formatting strings in Struts2/Freemarker

2007-11-09 Thread Dave Newton
Since you can use any S2 tag inside a FreeMarker
template I guess I had assumed you could use the same
syntax to call static methods you can from JSP, does
that not work?

(AFAIK you can also expose the JSTL library to a
FreeMarker page but I'm not sure how the two ELs would
play together; w/ OGNL you can use the %{...} EL
escape.)

d.

--- Scott Kingdon <[EMAIL PROTECTED]> wrote:

> I am very used to using JSP taglibs and el functions
> for formatting
> text. In my current application I am using Struts2
> with Freemarker as
> the templating engine. I need to format a phone
> number that is pulled
> from the database as 88 to be (888)888-.
> Using el
> functions you can just call a static method from
> some class. This
> would be nice since I already have that static
> method and it is used
> elsewhere in the app.
> 
> I would use JSP for this, but our template is
> already built in
> Freemarker. There are also come JSP pages that use
> this phone
> formatter as well. Actually I have already created
> the el function tag
> and have been using it all over in the app.
> 
> I have tried several things including trying to use
> el functions in
> freemarker or even including JSP pages from
> freemarker.
> 
> Any ideas how this is done in the Struts2/Freemarker
> world? I am open
> to any idea.
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


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



Re: Display tags within one line

2007-11-09 Thread Jeromy Evans

Hi Emi Lu,

The default struts2 tags use themes that determine how they are 
formatted as html[1].  The default theme 'xhtml' wraps each form input 
inside a table cell and prepends it with a label to the left or above.  
The css_xhtml theme uses the same layout with divs.


You have two options:
 - use the "simple" theme, which includes no formatting or labels but 
gives you complete control of the layout;

 - create your theme that sets out the layout you want.

The pages below are a good starting point.  It's seems common just use 
the simple theme, but if you want to create a lot of forms with similar 
layout creating your own theme can be worthwhile.


Hope that helps,
Jeromy Evans

[1] http://struts.apache.org/2.0.11/docs/themes-and-templates.html

Emi Lu wrote:

Hello,

May I know how to keep all checkbox in one line please?

 
 
 

I'd like to display

value1 value2 value3 in one line, but *not*

value1
value2
value3


Did I do something wrong? May I know how to display all tags within 
one line please?


Would also like to displayin the same line 
as well.


Thank you!




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







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



Re: Display tags within one line

2007-11-09 Thread Dave Newton
Use the simple theme.

d.

--- Emi Lu <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> May I know how to keep all checkbox in one line
> please?
> 
>name="value1_search"  />
>name="value2_search"  /> 
> 
>name="value3_search"  />
> 
> I'd like to display
> 
> value1 value2 value3 in one line, but *not*
> 
> value1
> value2
> value3
> 
> 
> Did I do something wrong? May I know how to display
> all tags within one 
> line please?
> 
> Would also like to display   
> in the same line as 
> well.
> 
> Thank you!
> 
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


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



Re: Display tags within one line

2007-11-09 Thread Scott Kingdon
Use . This will allow you to have 100% control
over the form html. Notice that by dong this you will have to handle
all the formatting of the table by yourself.

-Scott



On Nov 9, 2007 3:48 PM, Emi Lu <[EMAIL PROTECTED]> wrote:
> Hello,
>
> May I know how to keep all checkbox in one line please?
>
>   
>   
>
>   
>
> I'd like to display
>
> value1 value2 value3 in one line, but *not*
>
> value1
> value2
> value3
>
>
> Did I do something wrong? May I know how to display all tags within one
> line please?
>
> Would also like to displayin the same line as
> well.
>
> Thank you!
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Formatting strings in Struts2/Freemarker

2007-11-09 Thread Scott Kingdon
I am very used to using JSP taglibs and el functions for formatting
text. In my current application I am using Struts2 with Freemarker as
the templating engine. I need to format a phone number that is pulled
from the database as 88 to be (888)888-. Using el
functions you can just call a static method from some class. This
would be nice since I already have that static method and it is used
elsewhere in the app.

I would use JSP for this, but our template is already built in
Freemarker. There are also come JSP pages that use this phone
formatter as well. Actually I have already created the el function tag
and have been using it all over in the app.

I have tried several things including trying to use el functions in
freemarker or even including JSP pages from freemarker.

Any ideas how this is done in the Struts2/Freemarker world? I am open
to any idea.

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



Display tags within one line

2007-11-09 Thread Emi Lu

Hello,

May I know how to keep all checkbox in one line please?

 
  


 

I'd like to display

value1 value2 value3 in one line, but *not*

value1
value2
value3


Did I do something wrong? May I know how to display all tags within one 
line please?


Would also like to displayin the same line as 
well.


Thank you!




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



Re: S2 best location of application init params

2007-11-09 Thread Dave Newton
In addition, the application context is available to
S2 actions w/o being tied to servlet.

d.

--- Wes Wannemacher <[EMAIL PROTECTED]> wrote:

> There are two other options that I've used in the
> past... One is
> Spring. You could create a custom bean or set of
> beans and initialize
> them with Spring and use the spring plug-in to help
> get at those beans
> any time you need them.
> 
> Spring is a big framework though and will add some
> complexity. The
> other option, if you are hoping to keep from
> depending on the Servlet
> API is a static initializer block. The problem with
> static blocks
> though is that they can get out of control when you
> start adding them
> to obscure classes. If you only have a small amount
> of lifting to do,
> I would use a static block. The advantage is that it
> adds no external
> dependencies which will make unit testing easy, but
> the disadvantage
> is that it can become unwieldy.
> 
> If you are working on a large app, go with Spring,
> you may end up
> using some of it's other features. For a small app
> with minimal
> lifting, go with the static block. Of course,
> depending on the Servlet
> API isn't all bad, so don't count it out unless you
> really need to.
> 
> -W
> 
> On 11/9/07, tom` frost <[EMAIL PROTECTED]> wrote:
> > I would still need to use the Servlet API to
> retrieve those values,
> > correct?  I'm trying to find a way to pass in
> values directly to Struts, I
> > guess.
> >
> > On 11/9/00, Martin Gainty <[EMAIL PROTECTED]>
> wrote:
> > >
> > > Hi Tom-
> > >
> > > how about implementing the default
> initialisation parameters by placing
> > > the
> > > init-param in web.xml?
> > > e.g.
> > > 
> > > debug
> > > true
> > > 
> > >
> > > M--
> > > - Original Message -
> > > From: "tom` frost" <[EMAIL PROTECTED]>
> > > To: 
> > > Sent: Friday, November 09, 2007 12:41 PM
> > > Subject: S2 best location of application init
> params
> > >
> > >
> > > > I'm looking for the best place to put
> application init stuff.  I'm
> > > thinking
> > > > of something like the home directory of the
> file system to which the
> > > > application will write to.  What's the best
> way of apssing such
> > > information
> > > > in.  In the past I have used servlet api init
> params, but with all the
> > > > effort made in S2 to separate your code from
> Servlet api, surely there's
> > > a
> > > > better way.
> > > >
> > > > Thanks,
> > > > Tom
> > > >
> > >
> > >
> > >
>
-
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> >
> 
> 
> -- 
> Wesley Wannemacher
> President, Head Engineer/Consultant
> WanTii, Inc.
> http://www.wantii.com
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


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



Re: S2 best location of application init params

2007-11-09 Thread Jim Cushing
If you're using Spring (and if you're not, now might be the time to consider 
it), I'd say make that a property of your application object that needs to 
configuration. That is, using your example, say you've got a class, 
TransactionLogger that needs "the home directory of the file system to which 
the application will write." Give it a property, loggingDirectory, and 
configure it with Spring, giving it a bean id of "transactionLogger". Then, add 
Struts 2's Spring plugin to your project (just include the JAR), define a 
method setTransactionLogger(), and Spring/Struts will automatically inject the 
TransactionLogger instance into your object. In your action, just call 
transactionLogger.logTransaction(foo), and there you go!

Among the benefit of this approach are: 
1.You can unit test your business object (TransactionLogger) without involving 
Struts at all
2. The business object could be re-used outside your Struts application
3. The configuration is only where it needs to be; in the business object 
itself. So you don't have to come up with some naming convention for your 
init-params, nor do you have to write tedious code to make the business object 
aware of the configuration. That is, TranscationLogger doesn't have to be tied 
to the Servlet API, nor do you have to write an initialization servlet that 
creates a TransactionLogger.

This ventures off-topic from Struts 2, which should probably be your goal: your 
business objects should not be tied to Struts or the Servlet API.

 
On Friday, November 09, 2007, at 12:41PM, "tom` frost" <[EMAIL PROTECTED]> 
wrote:
>I'm looking for the best place to put application init stuff.  I'm thinking
>of something like the home directory of the file system to which the
>application will write to.  What's the best way of apssing such information
>in.  In the past I have used servlet api init params, but with all the
>effort made in S2 to separate your code from Servlet api, surely there's a
>better way.
>
>Thanks,
>Tom
>

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



Re: S2 best location of application init params

2007-11-09 Thread Wes Wannemacher
There are two other options that I've used in the past... One is
Spring. You could create a custom bean or set of beans and initialize
them with Spring and use the spring plug-in to help get at those beans
any time you need them.

Spring is a big framework though and will add some complexity. The
other option, if you are hoping to keep from depending on the Servlet
API is a static initializer block. The problem with static blocks
though is that they can get out of control when you start adding them
to obscure classes. If you only have a small amount of lifting to do,
I would use a static block. The advantage is that it adds no external
dependencies which will make unit testing easy, but the disadvantage
is that it can become unwieldy.

If you are working on a large app, go with Spring, you may end up
using some of it's other features. For a small app with minimal
lifting, go with the static block. Of course, depending on the Servlet
API isn't all bad, so don't count it out unless you really need to.

-W

On 11/9/07, tom` frost <[EMAIL PROTECTED]> wrote:
> I would still need to use the Servlet API to retrieve those values,
> correct?  I'm trying to find a way to pass in values directly to Struts, I
> guess.
>
> On 11/9/00, Martin Gainty <[EMAIL PROTECTED]> wrote:
> >
> > Hi Tom-
> >
> > how about implementing the default initialisation parameters by placing
> > the
> > init-param in web.xml?
> > e.g.
> > 
> > debug
> > true
> > 
> >
> > M--
> > - Original Message -
> > From: "tom` frost" <[EMAIL PROTECTED]>
> > To: 
> > Sent: Friday, November 09, 2007 12:41 PM
> > Subject: S2 best location of application init params
> >
> >
> > > I'm looking for the best place to put application init stuff.  I'm
> > thinking
> > > of something like the home directory of the file system to which the
> > > application will write to.  What's the best way of apssing such
> > information
> > > in.  In the past I have used servlet api init params, but with all the
> > > effort made in S2 to separate your code from Servlet api, surely there's
> > a
> > > better way.
> > >
> > > Thanks,
> > > Tom
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


-- 
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

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



Re: The breadcrumbs have been served!

2007-11-09 Thread stanlick
Hey Emi Lu --

The breadcrumb plug-in keeps a trail of crumbs up to the max you specify.
If you want to clear it (or manipulate it in some way) at particular points
in your workflow, you can do that by requesting it from the session and
doing whatever you like.  The documentation reveals how it is stored in
session.

Scott

On Nov 9, 2007 3:02 PM, Emi Lu <[EMAIL PROTECTED]> wrote:

> > Can you describe what logic you are looking for?
>  > What sort of application are you working on?
>
>
> Sorry, I did not know how the breadcrumb plug-in works.
>
> I hope the demo of "http://www.strutsschool.com/"; is not the showcase of
> how the plug-in works.
>
>
>
> The example shown by apache websites is the one I am looking for:
>
> Apache Struts 2 Plugin Registry > Home > Breadcrumbs Plugin
>
> When click home, the "Breadcrumbs Plugin" disappear.
>
> However, in "http://www.strutsschool.com/";, the linkage never disappears.
>
>
>
>
>
>
>
> >>
> >> For example, when user goes from home to page1 then to page 2, I would
> >> expect showing
> >>
> >> Home > Page1 > Page2
> >>
> >>
> >>
> >> When Users go back to Page1, showing "Home > Page1"
> >>
> >> When Users go to Home, showing "Home"
> >>
> >> Is the new Breadcrumbs
> >> plugin(http://cwiki.apache.org/S2PLUGINS/breadcrumbs-plugin.html)
> >> supports the above feature already?
> >>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Scott
[EMAIL PROTECTED]


Re: S2 best location of application init params

2007-11-09 Thread tom` frost
I would still need to use the Servlet API to retrieve those values,
correct?  I'm trying to find a way to pass in values directly to Struts, I
guess.

On 11/9/00, Martin Gainty <[EMAIL PROTECTED]> wrote:
>
> Hi Tom-
>
> how about implementing the default initialisation parameters by placing
> the
> init-param in web.xml?
> e.g.
> 
> debug
> true
> 
>
> M--
> - Original Message -
> From: "tom` frost" <[EMAIL PROTECTED]>
> To: 
> Sent: Friday, November 09, 2007 12:41 PM
> Subject: S2 best location of application init params
>
>
> > I'm looking for the best place to put application init stuff.  I'm
> thinking
> > of something like the home directory of the file system to which the
> > application will write to.  What's the best way of apssing such
> information
> > in.  In the past I have used servlet api init params, but with all the
> > effort made in S2 to separate your code from Servlet api, surely there's
> a
> > better way.
> >
> > Thanks,
> > Tom
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: The breadcrumbs have been served!

2007-11-09 Thread Emi Lu
Can you describe what logic you are looking for? 

> What sort of application are you working on?


Sorry, I did not know how the breadcrumb plug-in works.

I hope the demo of "http://www.strutsschool.com/"; is not the showcase of 
how the plug-in works.




The example shown by apache websites is the one I am looking for:

Apache Struts 2 Plugin Registry > Home > Breadcrumbs Plugin

When click home, the "Breadcrumbs Plugin" disappear.

However, in "http://www.strutsschool.com/";, the linkage never disappears.









For example, when user goes from home to page1 then to page 2, I would
expect showing

Home > Page1 > Page2



When Users go back to Page1, showing "Home > Page1"

When Users go to Home, showing "Home"

Is the new Breadcrumbs
plugin(http://cwiki.apache.org/S2PLUGINS/breadcrumbs-plugin.html)
supports the above feature already?



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



Re: The breadcrumbs have been served!

2007-11-09 Thread Emi Lu
There is a slight issue with www.strutsschool.com (demo site for the 
breadcrumb plugin?).  


This breadcrumb never got cleaned.

For example, when user goes from home to page1 then to page 2, I would 
expect showing


   Home > Page1 > Page2



When Users go back to Page1, showing "Home > Page1"

When Users go to Home, showing "Home"

Is the new Breadcrumbs 
plugin(http://cwiki.apache.org/S2PLUGINS/breadcrumbs-plugin.html) 
supports the above feature already?


Thanks!
-e

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



Re: S2 best location of application init params

2007-11-09 Thread Martin Gainty
Hi Tom-

how about implementing the default initialisation parameters by placing the
init-param in web.xml?
e.g.

debug
true


M--
- Original Message -
From: "tom` frost" <[EMAIL PROTECTED]>
To: 
Sent: Friday, November 09, 2007 12:41 PM
Subject: S2 best location of application init params


> I'm looking for the best place to put application init stuff.  I'm
thinking
> of something like the home directory of the file system to which the
> application will write to.  What's the best way of apssing such
information
> in.  In the past I have used servlet api init params, but with all the
> effort made in S2 to separate your code from Servlet api, surely there's a
> better way.
>
> Thanks,
> Tom
>


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



S2: dynamic forwarding from Action class to external url

2007-11-09 Thread Jiang, Jane (NIH/NCI) [C]
I am also trying to forward my Action to an external report URL after
process the form. I tried to use redirect and it always prefix my URL
with my application context.  

I also tried to implement ServletResponseAware and use
response.sendRedirect().  It does not seem to do anything.  The default
result "success" is used when I return null from my Action.

Is there a way to redirect action to an external URL? 

-Original Message-
From: Chris Pratt [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 07, 2007 12:44 PM
To: Struts Users Mailing List
Subject: Re: dynamic forwarding from Action class to any url

> > Is it possible to dynamicaly forward to any page from Action class
> > execute()

Make your Action implement ServletResponseAware, then just use the
response.sendRedirect() method to redirect to where you want to go.
Then return null from your action to let Struts 2 know that you've
handled things yourself.
  (*Chris*)

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

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



Re: [S2]Pass error message from called page back to calling page

2007-11-09 Thread Dave Newton
addActionError(...)?

--- Justin Frost <[EMAIL PROTECTED]> wrote:

> 
> My situation is that I have an input jsp.  On submit
> I call my struts action
> and do a DB query.  If I get an empty result I want
> to be directed back to
> the original input jsp and display an error message.
> 
> What is considered the best method for doing this?
> 
> I could add the message to the session context.
> -- 
> View this message in context:
>
http://www.nabble.com/-S2-Pass-error-message-from-called-page-back-to-calling-page-tf4778913.html#a13671094
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


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



S2 best location of application init params

2007-11-09 Thread tom` frost
I'm looking for the best place to put application init stuff.  I'm thinking
of something like the home directory of the file system to which the
application will write to.  What's the best way of apssing such information
in.  In the past I have used servlet api init params, but with all the
effort made in S2 to separate your code from Servlet api, surely there's a
better way.

Thanks,
Tom


[S2]Pass error message from called page back to calling page

2007-11-09 Thread Justin Frost

My situation is that I have an input jsp.  On submit I call my struts action
and do a DB query.  If I get an empty result I want to be directed back to
the original input jsp and display an error message.

What is considered the best method for doing this?

I could add the message to the session context.
-- 
View this message in context: 
http://www.nabble.com/-S2-Pass-error-message-from-called-page-back-to-calling-page-tf4778913.html#a13671094
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [struts] Thanks! Works also with redirect actions...

2007-11-09 Thread Dale Newfield

Dave Newton wrote:

You mean on a Result type?


On the "redirectAction" result type.


Personally I'd prefer this as the *default* behavior
and force you to specify if you *did* want "empty"
parameters included, but that's just me.


I agree, but I don't think the patch should change current behavior, 
just enable desired behavior.



This is probably more appropriately an XWork issue,
too, but it could be added to StrutsResultSupport (or
whatever that's called).


The patch I uploaded to the new JIRA issue (WW-2310) is against 
org.apache.struts2.dispatcher.ServletActionRedirectResult .


Since I've still not even migrated from 2.0.9 to 2.0.11 it'll be a while 
until I can benefit from this, but let's hope someone decides to test 
and commit it.


-Dale

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



Re: dojo version in struts 2.0.11?

2007-11-09 Thread Martin Gainty
referencing the dojo.js shipped with 2.0.11
\struts\struts-2.0.11\src\core\target\classes\org\apache\struts2\static\dojo
\src\namespaces
java -jar F:\RHINO\rhino1_6R5\js.jar
Rhino 1.6 release 5 2006 11 18
js> load("dojo.js");
js: "dojo.js", line 11: uncaught JavaScript runtime exception:
ReferenceError: "
dojo" is not defined.

--vs using the upgraded dojo-0.4.3-ajax version
\Dojo\dojo-0.4.3-ajax>java -jar F:\RHINO\rhino1_6R5\js.jar
Rhino 1.6 release 5 2006 11 18
js> load("dojo.js");
js> dojo.version
0.4.3 (8617)

appears for the moment 0.4.3 is the better version ..

Thanks/
Martin--
- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Friday, November 09, 2007 10:24 AM
Subject: Re: dojo version in struts 2.0.11?


> I wonder if it would be possible to retrofit the 2.1 Dojo plugin for 2.0?
>
> -Ted.
>
> On Nov 9, 2007 8:25 AM, Antonio Petrelli <[EMAIL PROTECTED]>
wrote:
> > 2007/11/9, Sami Dalouche <[EMAIL PROTECTED]>:
> > > If anyone is interested, I have created my own dojo 1.0.0 theme for
> > > standard Struts 2 tags. (works on Dojo 2.0.11).
> >
> > Sami and Alvaro:
> > if you want to contribute the Dojo 1.0 theme, then you probably file a
> > JIRA issue.
> > The simplest thing to do is creating a patch and attach it to the JIRA
> > issue itself.
> > You should create this patch against Struts 2 trunk (for 2.1.x
> > releases), where the Dojo theme is specified as a plugin:
> > http://svn.apache.org/repos/asf/struts/struts2/trunk/plugins/dojo/
> >
> > Ciao
> > Antonio
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> HTH, Ted 
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



Re: dojo version in struts 2.0.11?

2007-11-09 Thread Ted Husted
I wonder if it would be possible to retrofit the 2.1 Dojo plugin for 2.0?

-Ted.

On Nov 9, 2007 8:25 AM, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> 2007/11/9, Sami Dalouche <[EMAIL PROTECTED]>:
> > If anyone is interested, I have created my own dojo 1.0.0 theme for
> > standard Struts 2 tags. (works on Dojo 2.0.11).
>
> Sami and Alvaro:
> if you want to contribute the Dojo 1.0 theme, then you probably file a
> JIRA issue.
> The simplest thing to do is creating a patch and attach it to the JIRA
> issue itself.
> You should create this patch against Struts 2 trunk (for 2.1.x
> releases), where the Dojo theme is specified as a plugin:
> http://svn.apache.org/repos/asf/struts/struts2/trunk/plugins/dojo/
>
> Ciao
> Antonio
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
HTH, Ted 

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



struts 2: data lost when switching from jsp1 to jsp2 and back

2007-11-09 Thread hillybilly

hi,
i'm new in struts2 (i did already a projekt with struts 1) and i cannot find
lot of support/tutorials in the internet.

until now, i like struts2 and the new improvements. but i'm stuck with this:

i have 2 forms, on form1 the user enters data and selects "actionA" which
directs him to form2. here the user enters additional data and clicks on
"actionB" which should direct him back to form1. in this case, all the data
in form1 that user entered before is lost. 
moreover, how can i access data from form2? do i have to save data in the
session (session.setAttribute) ??

in struts1, i used a formbean with scope=session, so this was no problem
here.

i'm confused! :)
please help me!

cheers,
   chris
-- 
View this message in context: 
http://www.nabble.com/struts-2%3A-data-lost-when-switching-from-jsp1-to-jsp2-and-back-tf4778075.html#a13668330
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S.2.1] Wildcard Mappings + Struts s:url tag

2007-11-09 Thread Thilo Ettelt
Ok, how embarassing. Struts 1 got me trapped in this one, thus I 
considered that I'd have to pass the same action name as specified in 
the action mappings. Which is stupid of me because now it's Struts 2  
and now it's Wildcards. ;)


Using: 
solved my problem easily...


- Thilo

Thilo Ettelt wrote:

Hello,

I'm new to this list. I've learned a lot from the Confluence, but I 
couldn't figure out how to reassemble an wildcard action mapping using 
the s:url.
I figured that when there is an wildcard action and it can put parts 
of the request uri into my action bean or result string, then how can 
I put my attributes into an action URL using s:url tag?


This didn't work:


  
  


It just append two parameters. Isn't there a way to somehow "reverse" 
creating a wildcard mapped URL, meaning Struts assembles the right URL 
using the Wildcard settings and not regular parameters?


Thx in advance.


- Thilo

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




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



[S.2.1] Wildcard Mappings + Struts s:url tag

2007-11-09 Thread Thilo Ettelt

Hello,

I'm new to this list. I've learned a lot from the Confluence, but I 
couldn't figure out how to reassemble an wildcard action mapping using 
the s:url.
I figured that when there is an wildcard action and it can put parts of 
the request uri into my action bean or result string, then how can I put 
my attributes into an action URL using s:url tag?


This didn't work:


  
  


It just append two parameters. Isn't there a way to somehow "reverse" 
creating a wildcard mapped URL, meaning Struts assembles the right URL 
using the Wildcard settings and not regular parameters?


Thx in advance.


- Thilo

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



Re: Creating and setting properties of collections

2007-11-09 Thread Dave Newton
Pardon the disheveled nature of this response :/

Whether or not the image object need to be "recreated"
is more an issue w/ your persistence mechanism, but
you'll at least need some sort of UID for each.

On the S2 side you can create a map keyed on the UID
and expose whatever properties you want (like an
object.metadata field or just a string or whatever)
and use map notation on your form.

Check out the wiki page on type conversion to see a
bit more about how maps can be used:

http://struts.apache.org/2.x/docs/type-conversion.html

It's down towards the bottom. In a nutshell you can do
something like (pseudotag):



where the map is:

Map _theMap;

with an appropriate getter.

On submission your map will be filled in w/ the form's
values, the next step depends a bit on your
persistence mechanism.

d.


--- Mark Steyn <[EMAIL PROTECTED]> wrote:

> Forgive me is this is a very obvious question, but
> I'm new to struts 2,
> and despite googling around, I'm still not sure as
> to how to do
> something.
> 
> I'm trying to accomplish the following:
> 
> 1. Create a form which is used upload a zip file
> containing a number of
> images
> 2. Upload and process those images, creating java
> objects and database
> records for each.
> 3. Display a second form allowing the user to
> associate additional
> metadata with the images 
> 
> I'm currently stumped on step 3.
> 
> I can upload the images and create objects
> representing them, and create
> a form in a jsp allowing additional data to be
> associated with these
> objects, but once that form is submitted, I'm not
> sure how to map the
> posted data back to my image objects.  
> 
> From what I gather, the image objects that were
> created in step 2 need
> to be recreated in step 3, but I can't see an easy
> means of doing this.
> Are type converters the best way forward, or is
> there a better
> alternative?
> 
> Any assistance will be gratefully appreciated.
> 
> Mark 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


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



Re: dojo version in struts 2.0.11?

2007-11-09 Thread Antonio Petrelli
2007/11/9, Sami Dalouche <[EMAIL PROTECTED]>:
> If anyone is interested, I have created my own dojo 1.0.0 theme for
> standard Struts 2 tags. (works on Dojo 2.0.11).

Sami and Alvaro:
if you want to contribute the Dojo 1.0 theme, then you probably file a
JIRA issue.
The simplest thing to do is creating a patch and attach it to the JIRA
issue itself.
You should create this patch against Struts 2 trunk (for 2.1.x
releases), where the Dojo theme is specified as a plugin:
http://svn.apache.org/repos/asf/struts/struts2/trunk/plugins/dojo/

Ciao
Antonio

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



Re: [s2] templating approach / own tag?

2007-11-09 Thread Antonio Petrelli
2007/11/9, lbastil <[EMAIL PROTECTED]>:
>
>
> But what I originally thought of was something like parametrized approach
> of:
> http://www.vitarara.org/cms/struts_2_cookbook/creating_a_ui_component
>
> (I think for smaller substructures it could be reasonable)



Ah ok so you wanted to create an UI component!
I thought that you wanted to create a page layout, not a UI component: in
this case you are right, creating a custom Struts 2 UI component is the best
choice...
I hope it is not too late :-)

Antonio


Re: dojo version in struts 2.0.11?

2007-11-09 Thread Dave Newton
103: dojo.version = {
104:   // summary: version number of this instance of
dojo.
105:   major: 0, minor: 4, patch: 0, flag: "",
106:   revision: Number("$Rev: 6258
$".match(/[0-9]+/)[0]),

from the uncompressed file.

--- Jeromy Evans <[EMAIL PROTECTED]>
wrote:

> Does anyone know -exactly- which revision of dojo is
> bundled in Struts 
> 2.0.11?
> 
> A diff of the src dirs reveals it's not the tagged
> 0.4.2 release or 
> tagged 0.4.3 release.  I believe it's near 0.4.2 but
> can't find a match.
> 
> The dojo plugin in Struts 2.1.x definitely uses the
> 0.4.3 tagged release.
> 
> Max Pimm wrote
>  > Which is the dojo version that was used in the
> build of 
> struts2-core-0.011.jar?
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


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



Re: [struts] Thanks! Works also with redirect actions...

2007-11-09 Thread Dave Newton
--- Dale Newfield <[EMAIL PROTECTED]> wrote:
> ...any struts committers reading this:  If I
provided
> a patch for an extra specially named parameter like
> "supressEmptyParameters" that did just what you'd 
> expect, what are the chances that someone would 
> commit it?

You mean on a Result type?

Personally I'd prefer this as the *default* behavior
and force you to specify if you *did* want "empty"
parameters included, but that's just me.

This is probably more appropriately an XWork issue,
too, but it could be added to StrutsResultSupport (or
whatever that's called).

d.


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



Re: [s2] templating approach / own tag?

2007-11-09 Thread lbastil

Thank you all for the hints.

Finally I used tiles as it was recommended.

But what I originally thought of was something like parametrized approach
of:
http://www.vitarara.org/cms/struts_2_cookbook/creating_a_ui_component

(I think for smaller substructures it could be reasonable)

basti


newton.dave wrote:
> 
> You can still create custom tags in Java if you're
> dead-set on it.
> 
> Or you can use JSP 2.0 tags, where your tag
> implementation is in JSP.
> 
> There are a lot of ways of doing what you're trying to
> do. I don't know why you're opposed to using tiles,
> particularly if you're already invested in it.
> 
> d.
> 
> --- lbastil <[EMAIL PROTECTED]> wrote:
> 
>> 
>> Thank you for this hint, but in this case I don't
>> think so.
>> 
>> I am already use tiles for the overall page
>> structure, but for this
>> minor substructures I don't want to use a kind of
>> tiles sub-hierarchy.
>> 
>> Is there no equivalence to former custom tag?
>> 
>> Something like a ftl-script I can apply
>> parametrized?
>> 
>> Thank you,
>> basti   
>> 
>> 
>> Antonio Petrelli-3 wrote:
>> > 
>> > 2007/11/2, lbastil <[EMAIL PROTECTED]>:
>> >>
>> >>
>> >> Hi,
>> >>
>> >> I want to archive the following:
>> >>
>> >> I noticed in my page code often this redundant
>> structure:
>> >> (dynamic parts in [])
>> >>
>> >>
>> >> 
>> >> [Header Section Name]
>> >> 
>> >> 
>> >> [
>> >> ... various different content, tables, ... and so
>> on
>> >> ]
>> >> 
>> >>
>> >> Now I would like to create some parameterized
>> template, something I could
>> >> call like:
>> >> (pseudocode):
>> >> 
>> >> [
>> >> ... various different content, tables, ... and so
>> on
>> >> ]
>> >> 
>> >>
>> >> which produces the code shown above dynamically.
>> >>
>> >> How can I do this most easy with struts2
>> framework?
>> >> (in struts1 I would have created an own tag)
>> > 
>> > 
>> > 
>> > I think this is a task for Tiles :-)
>> > http://tiles.apache.org/
>> > Struts 2 contains a Tiles plugin:
>> >
>> http://struts.apache.org/2.x/docs/tiles-plugin.html
>> > 
>> > Antonio
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/-s2--templating-approach---own-tag--tf4737793.html#a13549228
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>> 
>> 
>>
> -
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>> 
>> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-s2--templating-approach---own-tag--tf4737793.html#a13665643
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Dojo custom build and Struts ComboBox widget

2007-11-09 Thread Max Pimm

wiki updated

http://cwiki.apache.org/confluence/display/S2WIKI/Creating+a+custom+Dojo+profile+for+Struts+2.0.x

Jeromy Evans wrote:
Urgh... I was trying to create a build from the src in 2.0.9 as well 
without any progress.  Glad you solved it.
Yes, please go ahead and update the wiki.  I was the original author 
of that page and that's why it's a wiki :-)


Max Pimm wrote:

Solved.

I have downloaded and created the custom build from the dojo 0.4.0 
release instead of dojo 0.4.2 and now all works well. From comparing 
files i am pretty sure that 0.4.0 was the release used in the 
struts2.0.11, 2.0.10, 2.0.9 and 2.0.8 releases but it would be good 
if someone could confirm that.


We should also update the wiki 
(http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-209.html) 
to change all references to 0.4.2 to 0.4.0. I have access but perhaps 
this should be approved by the developers first?


max

Max Pimm wrote:
I am using firebug and Venkman to debug. No requests are sent to get 
data for the list. After debugging the problem seems to be that the 
Struts comboBoxDataProvider's init method never gets called. This 
means the widget never loads data from the server. Every time the 
user edits the input field events are fired and the widget searches 
for data matching the input string. However since no data is loaded 
from the server no match is found and no autocomplete list is shown.


So the problem is with the data provider. Looking more carefully at 
the dojo.widget.ComboBox component the problem would seem to be that 
the 0.4.2 release of dojo is NOT the same as the one bundled with 
struts. There are significant differences in the dojo.ComboBox and 
data provider in the two versions. I've tried copying the dojo code 
included in the struts bundle to the dojo 0.4.2 release but the 
build fails.


Which is the dojo version that was used in the build of 
struts2-core-0.011.jar?




Jeromy Evans wrote:

Max Pimm wrote:
I am trying to make a custom build of dojo for my application in 
order to speed it up a bit.


(See threads "[s2] Struts head tag KILLS (> 10s) page load time" 
and "How to improve dojo performance in Struts 2.0.9")


I have followed the instructions for doing this are carefully as 
possible from 
http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-209.html. 



My custom build appears to have worked. dojo.js is generated with 
the struts widgets "Internalized", each page i load makes minimal 
requests for other dojo scripts and the basic bind functionality 
of dojo works.


However the Struts:Combobox component used in my autocompleters 
does not work. Some code is executed when i edit the field but it 
does not result in a petition to the server y hence no 
autocomplete list is shown. Dojo is configured in debug mode but 
gives no errors. The struts folder containing the widgets is 
present in /struts/dojo. Dojo correctly finds the 
dropdown image for the input and uses the styles in ComboBox.css 
the only problem is that it does not issue petitions to the server 
when the onKeyUp event fires.


I am using the 2.011 build of struts, is the process for building 
a custom dojo build the same as in 2.09? I can't find any changes 
in the ComboBox between these versions but is there anything else 
that might be causing these problems.


Does anyone have any advice for how to start debugging this?

Thanks,

max


I'm not sure what is wrong, but the approach I'd take to debug it is:
 - Use firebug to see if the page is getting a 404 trying to load 
any of the resources required by dojo.  This is the most likely 
cause if it was working before you created the custom build
 - Replace your dojo.js file with the dojo.js-uncompressed.js file 
also created by the build process.  This one contains comments and 
debug info.  See if any errors are now displayed
 - Find the combobox code in dojo.js-uncompressed.js and use 
breakpoints in firebug to find out exactly what's happening.


Let me know how you go.
cheers,
Jeormy Evans






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





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





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







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





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



Re: dojo version in struts 2.0.11?

2007-11-09 Thread Alvaro Sanchez-Mariscal
Hi Sami,

My company (Salenda) is willing to contribute to get a
production-quality version.

Perhaps sharing source code in a cvs/subversion may be a good starting point.

Anybody else interested?

Alvaro.

On Nov 9, 2007 12:09 PM, Sami Dalouche <[EMAIL PROTECTED]> wrote:
> If anyone is interested, I have created my own dojo 1.0.0 theme for
> standard Struts 2 tags. (works on Dojo 2.0.11).
>
> It's far from being *clean*, far from being complete, uses undocumented
> attributes, but is a good starting guide to create progressive
> JavaScript enhancement (falls back to pure HTML widgets if JS is not
> enabled).
>
> So, do not hesitate to drop me an email if you want to look at the code,
> or plan to cleanly repackage it for Struts, it's available under
> whatever open source license you prefer.
>
> Regards,
> Sami Dalouche
>
>
>
> On Fri, 2007-11-09 at 21:25 +1100, Jeromy Evans wrote:
> > Does anyone know -exactly- which revision of dojo is bundled in Struts
> > 2.0.11?
> >
> > A diff of the src dirs reveals it's not the tagged 0.4.2 release or
> > tagged 0.4.3 release.  I believe it's near 0.4.2 but can't find a match.
> >
> > The dojo plugin in Struts 2.1.x definitely uses the 0.4.3 tagged release.
> >
> > Max Pimm wrote
> >  > Which is the dojo version that was used in the build of
> > struts2-core-0.011.jar?
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Alvaro Sanchez-Mariscal Arnaiz
Java EE Architect & Instructor
[EMAIL PROTECTED]

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



Creating and setting properties of collections

2007-11-09 Thread Mark Steyn
Forgive me is this is a very obvious question, but I'm new to struts 2,
and despite googling around, I'm still not sure as to how to do
something.

I'm trying to accomplish the following:

1. Create a form which is used upload a zip file containing a number of
images
2. Upload and process those images, creating java objects and database
records for each.
3. Display a second form allowing the user to associate additional
metadata with the images 

I'm currently stumped on step 3.

I can upload the images and create objects representing them, and create
a form in a jsp allowing additional data to be associated with these
objects, but once that form is submitted, I'm not sure how to map the
posted data back to my image objects.  

>From what I gather, the image objects that were created in step 2 need
to be recreated in step 3, but I can't see an easy means of doing this.
Are type converters the best way forward, or is there a better
alternative?

Any assistance will be gratefully appreciated.

Mark 


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



Re: dojo version in struts 2.0.11?

2007-11-09 Thread Sami Dalouche
If anyone is interested, I have created my own dojo 1.0.0 theme for
standard Struts 2 tags. (works on Dojo 2.0.11).

It's far from being *clean*, far from being complete, uses undocumented
attributes, but is a good starting guide to create progressive
JavaScript enhancement (falls back to pure HTML widgets if JS is not
enabled).

So, do not hesitate to drop me an email if you want to look at the code,
or plan to cleanly repackage it for Struts, it's available under
whatever open source license you prefer.

Regards,
Sami Dalouche


On Fri, 2007-11-09 at 21:25 +1100, Jeromy Evans wrote:
> Does anyone know -exactly- which revision of dojo is bundled in Struts 
> 2.0.11?
> 
> A diff of the src dirs reveals it's not the tagged 0.4.2 release or 
> tagged 0.4.3 release.  I believe it's near 0.4.2 but can't find a match.
> 
> The dojo plugin in Struts 2.1.x definitely uses the 0.4.3 tagged release.
> 
> Max Pimm wrote
>  > Which is the dojo version that was used in the build of 
> struts2-core-0.011.jar?
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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



RolesInterceptor. How to..?

2007-11-09 Thread Filippov, Andrey
Hi everybody!

I need to configure the login and authorization system in my application.  I 
have struts2 together with jboss and mysql. I found the following information 
about it:  
(http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/interceptor/RolesInterceptor.html,
 http://struts.apache.org/2.0.11/docs/interceptors.html), 
http://www.vitarara.org/cms/struts_2_cookbook/creating_a_login_interceptor. 
As I understand the logic should be like this: from login.jsp get username and 
password, then get information about the user from mysql db (I mean confirming 
information about existence of the user and additional information about roles 
of the user), then put this information into session, then use RolesInterceptor 
to define access to the certain action. Am I right?
But I have not caught yet how could I put user object (see ref#3 - vitarara...) 
with information about login, password and roles (which are in the mysql db) 
into session?
 
RolesInterceptor class has the setAllowedRoles method. Could I use it to define 
a set of roles for user? How could I Do it? 
I appreciate any kind of help! Thanx a lot!!!


Sincerely yours,
Andrey V. Filippov



Re: Dojo custom build and Struts ComboBox widget

2007-11-09 Thread Jeromy Evans
Urgh... I was trying to create a build from the src in 2.0.9 as well 
without any progress.  Glad you solved it. 

Yes, please go ahead and update the wiki.  I was the original author of 
that page and that's why it's a wiki :-)


Max Pimm wrote:

Solved.

I have downloaded and created the custom build from the dojo 0.4.0 
release instead of dojo 0.4.2 and now all works well. From comparing 
files i am pretty sure that 0.4.0 was the release used in the 
struts2.0.11, 2.0.10, 2.0.9 and 2.0.8 releases but it would be good if 
someone could confirm that.


We should also update the wiki 
(http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-209.html) 
to change all references to 0.4.2 to 0.4.0. I have access but perhaps 
this should be approved by the developers first?


max

Max Pimm wrote:
I am using firebug and Venkman to debug. No requests are sent to get 
data for the list. After debugging the problem seems to be that the 
Struts comboBoxDataProvider's init method never gets called. This 
means the widget never loads data from the server. Every time the 
user edits the input field events are fired and the widget searches 
for data matching the input string. However since no data is loaded 
from the server no match is found and no autocomplete list is shown.


So the problem is with the data provider. Looking more carefully at 
the dojo.widget.ComboBox component the problem would seem to be that 
the 0.4.2 release of dojo is NOT the same as the one bundled with 
struts. There are significant differences in the dojo.ComboBox and 
data provider in the two versions. I've tried copying the dojo code 
included in the struts bundle to the dojo 0.4.2 release but the build 
fails.


Which is the dojo version that was used in the build of 
struts2-core-0.011.jar?




Jeromy Evans wrote:

Max Pimm wrote:
I am trying to make a custom build of dojo for my application in 
order to speed it up a bit.


(See threads "[s2] Struts head tag KILLS (> 10s) page load time" 
and "How to improve dojo performance in Struts 2.0.9")


I have followed the instructions for doing this are carefully as 
possible from 
http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-209.html. 



My custom build appears to have worked. dojo.js is generated with 
the struts widgets "Internalized", each page i load makes minimal 
requests for other dojo scripts and the basic bind functionality of 
dojo works.


However the Struts:Combobox component used in my autocompleters 
does not work. Some code is executed when i edit the field but it 
does not result in a petition to the server y hence no autocomplete 
list is shown. Dojo is configured in debug mode but gives no 
errors. The struts folder containing the widgets is present in 
/struts/dojo. Dojo correctly finds the dropdown image 
for the input and uses the styles in ComboBox.css the only problem 
is that it does not issue petitions to the server when the onKeyUp 
event fires.


I am using the 2.011 build of struts, is the process for building a 
custom dojo build the same as in 2.09? I can't find any changes in 
the ComboBox between these versions but is there anything else that 
might be causing these problems.


Does anyone have any advice for how to start debugging this?

Thanks,

max


I'm not sure what is wrong, but the approach I'd take to debug it is:
 - Use firebug to see if the page is getting a 404 trying to load 
any of the resources required by dojo.  This is the most likely 
cause if it was working before you created the custom build
 - Replace your dojo.js file with the dojo.js-uncompressed.js file 
also created by the build process.  This one contains comments and 
debug info.  See if any errors are now displayed
 - Find the combobox code in dojo.js-uncompressed.js and use 
breakpoints in firebug to find out exactly what's happening.


Let me know how you go.
cheers,
Jeormy Evans






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





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





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







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



Re: Dojo custom build and Struts ComboBox widget

2007-11-09 Thread Max Pimm

Solved.

I have downloaded and created the custom build from the dojo 0.4.0 
release instead of dojo 0.4.2 and now all works well. From comparing 
files i am pretty sure that 0.4.0 was the release used in the 
struts2.0.11, 2.0.10, 2.0.9 and 2.0.8 releases but it would be good if 
someone could confirm that.


We should also update the wiki 
(http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-209.html) 
to change all references to 0.4.2 to 0.4.0. I have access but perhaps 
this should be approved by the developers first?


max

Max Pimm wrote:
I am using firebug and Venkman to debug. No requests are sent to get 
data for the list. After debugging the problem seems to be that the 
Struts comboBoxDataProvider's init method never gets called. This 
means the widget never loads data from the server. Every time the user 
edits the input field events are fired and the widget searches for 
data matching the input string. However since no data is loaded from 
the server no match is found and no autocomplete list is shown.


So the problem is with the data provider. Looking more carefully at 
the dojo.widget.ComboBox component the problem would seem to be that 
the 0.4.2 release of dojo is NOT the same as the one bundled with 
struts. There are significant differences in the dojo.ComboBox and 
data provider in the two versions. I've tried copying the dojo code 
included in the struts bundle to the dojo 0.4.2 release but the build 
fails.


Which is the dojo version that was used in the build of 
struts2-core-0.011.jar?




Jeromy Evans wrote:

Max Pimm wrote:
I am trying to make a custom build of dojo for my application in 
order to speed it up a bit.


(See threads "[s2] Struts head tag KILLS (> 10s) page load time" and 
"How to improve dojo performance in Struts 2.0.9")


I have followed the instructions for doing this are carefully as 
possible from 
http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-209.html. 



My custom build appears to have worked. dojo.js is generated with 
the struts widgets "Internalized", each page i load makes minimal 
requests for other dojo scripts and the basic bind functionality of 
dojo works.


However the Struts:Combobox component used in my autocompleters does 
not work. Some code is executed when i edit the field but it does 
not result in a petition to the server y hence no autocomplete list 
is shown. Dojo is configured in debug mode but gives no errors. The 
struts folder containing the widgets is present in 
/struts/dojo. Dojo correctly finds the dropdown image 
for the input and uses the styles in ComboBox.css the only problem 
is that it does not issue petitions to the server when the onKeyUp 
event fires.


I am using the 2.011 build of struts, is the process for building a 
custom dojo build the same as in 2.09? I can't find any changes in 
the ComboBox between these versions but is there anything else that 
might be causing these problems.


Does anyone have any advice for how to start debugging this?

Thanks,

max


I'm not sure what is wrong, but the approach I'd take to debug it is:
 - Use firebug to see if the page is getting a 404 trying to load any 
of the resources required by dojo.  This is the most likely cause if 
it was working before you created the custom build
 - Replace your dojo.js file with the dojo.js-uncompressed.js file 
also created by the build process.  This one contains comments and 
debug info.  See if any errors are now displayed
 - Find the combobox code in dojo.js-uncompressed.js and use 
breakpoints in firebug to find out exactly what's happening.


Let me know how you go.
cheers,
Jeormy Evans






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





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





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



dojo version in struts 2.0.11?

2007-11-09 Thread Jeromy Evans
Does anyone know -exactly- which revision of dojo is bundled in Struts 
2.0.11?


A diff of the src dirs reveals it's not the tagged 0.4.2 release or 
tagged 0.4.3 release.  I believe it's near 0.4.2 but can't find a match.


The dojo plugin in Struts 2.1.x definitely uses the 0.4.3 tagged release.

Max Pimm wrote
> Which is the dojo version that was used in the build of 
struts2-core-0.011.jar?


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



Re: OGNL struts property

2007-11-09 Thread

Horay! You are the first person to actually see and acknowledge the problem.
So far I have only recieved comments about the difference between the hash
and the non hash version - which I get. But no one has explained why in the
case of #2 OGNL returns null and not the value of the property as in #1.

Any one else know?

To quote another email:

>>  is not
>> > 
>> for 2 reasons:
>> contextKey+".title" says take entity one called contextKey which is null
>> and append string of .title
>> says '' delivers literal constant
>
> The entity contextKey is not null (this is seen by the other example which
> echoes the content) 
> unless adding an operator (+) in this case introduced a new implicit scope
> (which goes against 
> my expectations). Then perhaps in the scope of the + the contextKey entity
> is not defined - 
> consequently it returns null appended to the literal? (if thats so, then
> ognl is very odd)
>
> Or have I still not got it?
>
> Cheers
>Caleb.




newton.dave wrote:
> 
> To continue, the first one (probably; I'm still a
> little fuzzy on OGNL sometimes) works because if a
> property isn't found in the action it will continue
> looking on the stack until it finds it or runs out.
> 
> Now, as to why #2 "doesn't work", I'm a little hazier
> on that: perhaps when OGNL has an expression tree it
> does lookup a bit differently or something?
> 
> d.
> 
> 
> --- Musachy Barroso <[EMAIL PROTECTED]> wrote:
> 
>> in OGNL there is always an object that is the
>> "root", so %{name} is
>> actually calling root.getName(). The "#" is used to
>> reference
>> something else than the root. In your views, your
>> action will be the
>> OGNL root (unless some tag pushes something to the
>> stack), to refer to
>> your property you would need #contextKey.
>> 
>> 
>> musachy
>> 
>> On Nov 8, 2007 7:13 AM, J&M <[EMAIL PROTECTED]>
>> wrote:
>> >
>> > Hi,
>> >
>> > Can any body explain the following to me, I don't
>> quite grok it. I have
>> > added a property value via my action
>> >
>> > ActionContext ctx = ActionContext.getContext();
>> > ctx.put("contextKey", "developer.page.logout");
>> >
>> > In the jsp I have the following:
>> >
>> > 1 
>> > 2 
>> > 3 
>> > 4 
>> >
>> > This results in an output:
>> >
>> > 1 developer.page.logout
>> > 2 null.title
>> > 3 developer.page.logout.title
>> > 4 string1.title
>> >
>> > Why does 2 give me a null output and 1 not, and 3
>> give me what I want.
>> > What is the significance of the # in this case?
>> >
>> > Cheers
>> > Caleb.
>> >
>> > --
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/OGNL-struts-property-tf4770568.html#a13664415
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Dojo custom build and Struts ComboBox widget

2007-11-09 Thread Max Pimm
I am using firebug and Venkman to debug. No requests are sent to get 
data for the list. After debugging the problem seems to be that the 
Struts comboBoxDataProvider's init method never gets called. This means 
the widget never loads data from the server. Every time the user edits 
the input field events are fired and the widget searches for data 
matching the input string. However since no data is loaded from the 
server no match is found and no autocomplete list is shown.


So the problem is with the data provider. Looking more carefully at the 
dojo.widget.ComboBox component the problem would seem to be that the 
0.4.2 release of dojo is NOT the same as the one bundled with struts. 
There are significant differences in the dojo.ComboBox and data provider 
in the two versions. I've tried copying the dojo code included in the 
struts bundle to the dojo 0.4.2 release but the build fails.


Which is the dojo version that was used in the build of 
struts2-core-0.011.jar?




Jeromy Evans wrote:

Max Pimm wrote:
I am trying to make a custom build of dojo for my application in 
order to speed it up a bit.


(See threads "[s2] Struts head tag KILLS (> 10s) page load time" and 
"How to improve dojo performance in Struts 2.0.9")


I have followed the instructions for doing this are carefully as 
possible from 
http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-209.html. 



My custom build appears to have worked. dojo.js is generated with the 
struts widgets "Internalized", each page i load makes minimal 
requests for other dojo scripts and the basic bind functionality of 
dojo works.


However the Struts:Combobox component used in my autocompleters does 
not work. Some code is executed when i edit the field but it does not 
result in a petition to the server y hence no autocomplete list is 
shown. Dojo is configured in debug mode but gives no errors. The 
struts folder containing the widgets is present in 
/struts/dojo. Dojo correctly finds the dropdown image 
for the input and uses the styles in ComboBox.css the only problem is 
that it does not issue petitions to the server when the onKeyUp event 
fires.


I am using the 2.011 build of struts, is the process for building a 
custom dojo build the same as in 2.09? I can't find any changes in 
the ComboBox between these versions but is there anything else that 
might be causing these problems.


Does anyone have any advice for how to start debugging this?

Thanks,

max


I'm not sure what is wrong, but the approach I'd take to debug it is:
 - Use firebug to see if the page is getting a 404 trying to load any 
of the resources required by dojo.  This is the most likely cause if 
it was working before you created the custom build
 - Replace your dojo.js file with the dojo.js-uncompressed.js file 
also created by the build process.  This one contains comments and 
debug info.  See if any errors are now displayed
 - Find the combobox code in dojo.js-uncompressed.js and use 
breakpoints in firebug to find out exactly what's happening.


Let me know how you go.
cheers,
Jeormy Evans






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





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