Re: JSF -> Shale transition

2005-09-09 Thread Dakota Jack
Hi, Rick.  The fact is that this gentleman asked for an opinion that
will influence his business.  I think he deserves an honest answer,
even if the "debate" might be old hat to you.

On 9/9/05, Rick Reumann <[EMAIL PROTECTED]> wrote:
> Walton, Kaleb (ISS Southfield) wrote the following on 9/9/2005 9:17 AM:
> > What do you mean by "inferior if you are interested in performance". Is
> > the overhead of the dialog/navigation processing pretty high?
> 
> Oh no:) Here we go again:)...
> 
> JSF sucks.
> No, Sruts sucks.
> Spring rules.
> No, Spring sucks.
> Your momma.
> No, Your momma!
> Tapestry baby.
> blah.. WebWorks!
> No way, .NET For the win!
> .NET, you're crazy.
> Cocoon and Echo framework is the best.
> Come on Flash all the way.
> Your momma again.
> 
> 
> It's Friday right?:)
> 
> --
> Rick
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: JSF -> Shale transition

2005-09-09 Thread Dakota Jack
The point is not about Struts, which performs fine.  THe problem is
with JSF, which does not.

On 9/9/05, Gary VanMatre <[EMAIL PROTECTED]> wrote:
> > What do you mean by "inferior if you are interested in performance". Is
> > the overhead of the dialog/navigation processing pretty high?
> >
> 
> In perspective, vanilla servlet programming is faster than Struts.
> 
> Isn't it relative to what you *value* in a web framework.
> 
> Gary
> 
> 
> > -Original Message-
> > From: Dakota Jack [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, September 08, 2005 4:19 PM
> > To: Struts Users Mailing List
> > Subject: Re: JSF -> Shale transition
> >
> > Well, have you considered classic struts?  Shale is really meant for
> > people who are trying to change an application from JSF to Struts, and
> > not everyone, including myself, think this is a good idea.  Shale is not
> > Struts improved but a transition to something entirely different, and
> > inferior in my opinion, if you are interested in performance.
> >
> > On 9/8/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:
> > > We're wanting to go from our home-brewed method of interaction using
> > > jsps and servlets that are not very consistent in their expression
> > > (other than the general jsp/servlet specs) to something that defines
> > > interactions more concretely. Our current frustrations include form
> > > handling, page transitions, forwarding, etc.
> > >
> > > Regards,
> > > Kaleb
> > >
> > > -Original Message-
> > > From: Dakota Jack [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, September 08, 2005 12:44 AM
> > > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > > Subject: Re: JSF -> Shale transition
> > >
> > > Moving from Struts to JSF is moving to a "more defined" framework?
> > > That is pretty difficult to grasp.  Could you explain?
> > >
> > >
> > >
> > > On 9/6/05, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> > > > On 9/6/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Hey all,
> > > > >
> > > > > As I had mentioned in a previous post, our team is looking to move
> >
> > > > > towards a more well defined web framework. From my limited
> > > > > experience using Shale (ran the shale-use-cases) I'm not feeling
> > > > > very confident that we could use it *right away*.
> > > > >
> > > > > I wanted to ask for opinions on what would be a gradual step for
> > > > > us to take towards the Shale framework (once it's stable enough to
> >
> > > > > use in a production environment). For example, would JSF + Spring
> > > > > be a good combo that would make for an easy transition to Shale?
> > > > > Struts +
> > >
> > > > > WebFlow + Spring? Etc..
> > > > >
> > > > > Do the aforementioned framework combinations even matter? Will
> > > > > Shale
> > >
> > > > > just add another layer on top or glue together with what we would
> > > > > have already developed? Although I've been reading up on Shale
> > > > > quite
> > >
> > > > > a bit, my understanding is still limited so please excuse me if
> > > > > these questions are easily found through already documented
> > sources.
> > >
> > > > > If they are, please share where they can be found :)
> > > >
> > > >
> > > >
> > > > The key to choosing a transition approach is what you want to use
> > > > for the "front controller" part of your architecture durng the
> > > > interim. If
> > >
> > > > you're starting from Struts, a straightforward path would be to use
> > > > the integration library to start switching your pages to using JSF
> > > > components instead of Struts HTML tags (without having to modify
> > > > your actions), followed by a migration of the back-end logic to
> > > > using JSF's
> > >
> > > > front controller and request processing lifecycle.
> > > >
> > > > If, on the other hand, you decide to commit to JSF's controller
> > > > early rather than late, you might as well just use Shale along with
> > > > it from the beginning. Unlike the way that other frameworks deal
> > > > with JSF, Shale
> > > > *assumes* you will be using the JSF controller architecture, and it
> > > > just adds ease of use around problems you'll face anyway. It doesn't
> >
> > > > try to treat JSF as purely a component architecture.
> > > >
> > > > Craig McClanahan
> > > >
> > > > Regards,
> > > > > Kaleb
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: Who decides?

2005-09-09 Thread Dakota Jack
I sympathize entirely with what you are saying, Murray, and believe
that there is no good reason for the present difficulties you face. 
The situation is NOT inevitable or even desirable.

I would strongly suggest you consider the Spring alternative which is
highly unlikely to change in fundamentals for a very long time.

There is no vision here that is not willy nilly and merely fulfilling
some philosophical opinions about community which come down to
servicing the older committers' daytime jobs and reputatoins, in my
opinion.  They say that too, but I will guess that they don't want
anyone else saying it.

Struts is a very unstable community producing inferior code at this
point with political infighting on a "nice" level to steal the name
for the latest and greatest old idea trying to claim to be very, very,
very new.


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: Who decides?

2005-09-09 Thread Craig McClanahan
There's no way to respond to quite all of the fascinating questions you are 
raising in one message, but I'm packing up tonight to head for Beijing to 
speak at the inagural Java China Conference (http://www.javachina.cn), so 
I've got a few minutes to wax philosophical. This is also probably worth a 
couple of blog entries, too, but those will have to wait until I have time 
to sit down and compose them.

A (very few) scatttered comments inline ... not commenting on something 
doesn't mean I do not find it interesting, just that I have a limited amount 
of time to respond tonight.

On 9/9/05, Murray Collingwood <[EMAIL PROTECTED]> wrote:
> 
> I'm just a humble Struts user (and relatively new), and I don't claim to 
> speak for the
> group as a whole.
> 
> I have read through Donald Brown's presentation (Struts 1.3 and beyond) 
> and I get the
> feeling that the goal posts just don't stop moving.


I'm afraid that this is the nature of the software developer landscape. 
You've heard the term "Internet time"? That is the environment in which we 
(as application architects) need to decide which technoogies to become 
dependent upon. The gamble, of course, is that the lifetime of the 
technology will correspond with the lifetime of the application you build on 
top of it. Sometimes you win, sometimes you lose.

Ironically, Struts 1.x triggers people to respond at both extremes, as well 
as everywhere in the middle:

* It evolves very slowly, engendering confidence that I can count on support
over a multiple year lifetime for my application.

* It evolves very slowly, and since it was originally designed five years 
ago,
it is hopelessly out of date relative to current best practices, and should
be tossed on the trash heap.

Both answers are quite reasonable and understandable ... depending on your 
perspective.

The time I have spent learning and creating a Struts application should be 
> an
> investment in my future development, not a stepping stone to a whole new 
> set of
> technologies that will continue to slow my productivity (through on-going 
> training).


I think this goal is reasonable in the short term, but naive in the long 
term. You have to *count* on the technologies you understand today becoming 
obsolete -- and the pace of that obsolescence is higher in software than in 
any other profession I've ever looked at (although they *all* suffer from 
this). A couple of thought points on this topic to consider:

* My son (now in his early 20s) is also a geek -- he really likes PHP, but
I love him anyway :-). In between contract jobs, he's working towards a
college degree ... but he's taking my advice to do something other than
Computer Science. Why? Because even if he were following the traditional
route of doing college in four years, anything *technical* he learned would
be totally obsolete by the time he graduated. It's important to learn the 
fundamental
principles of good software development, but you've got to understand that
the point technologies you use at any given time are ephemeral.

* I took my own advice when *I* was in college :-), and have a Business 
Administration
degree, with an emphasis in Accounting. You'd think (from the outside) that 
there couldn't
possibly be a profession that changes slower than accounting, but I can 
guarantee you that
this is not the case. Once you get past double entry bookkeeping, everything 
I learned in
college (even if I remembered it all, 30 years later) would be totally 
obsolete.

* The same sort of thing happens in scientific fields all over the map. For 
example,
I aced a test on Astronomy by (among other things) nothing that Jupiter had 
12 moons,
Saturn had 9, and so on. Those facts were considered true at the time ... 
but not any more.

* Would you trust a doctor today to diagnose you with a 1950s medical 
education?
Or even a 1990s medical education? Like basically all professions, medicine 
(and software)
assume that a lifetime of learning new things is a fundamental requirement 
for success.

I spent more time on this particular paragraph than the others below, to 
give you a feel for why I answer some of those questions the way I do.

Who, and this is my question, who makes the decision whether a technology is 
> going to
> be good for the greater community? Who asks the questions "Do we need 
> it?", "Will
> the technology provide significantly greater returns than training 
> costs?", "Will the
> technology last long enough to deliver those returns?"


Software development is like everything else ... it doesn't come with a 
crystal ball. At best, someone tries to create an answer to perceived needs, 
and then the market responds by indicating whether (a) the need was actual, 
and (b) the provided solution actually met that need.

Open source software has very different economics on doing this sort of 
stuff than you see in traditional product development at corporations that 
build and sell "stuff", but it's the same basic issues unde

Who decides?

2005-09-09 Thread Murray Collingwood
I'm just a humble Struts user (and relatively new), and I don't claim to speak 
for the 
group as a whole.

I have read through Donald Brown's presentation (Struts 1.3 and beyond) and I 
get the 
feeling that the goal posts just don't stop moving.

The time I have spent learning and creating a Struts application should be an 
investment in my future development, not a stepping stone to a whole new set of 
technologies that will continue to slow my productivity (through on-going 
training).

Who, and this is my question, who makes the decision whether a technology is 
going to 
be good for the greater community?  Who asks the questions "Do we need it?",  
"Will 
the technology provide significantly greater returns than training costs?", 
"Will the 
technology last long enough to deliver those returns?"

Who is it that has decided we need to keep extending the Struts framework 
without 
considering the developers' need for better problem identification and 
documentation of 
the existing Struts system.  This list gets so many emails of people struggling 
with 
existing technology: Dynaforms, Validation, Iteration, Cookies, Flow control, 
and the 
number of different versions of everything "out there" that we need to know 
about in 
order to work with this system.

Who answers the question, "Why aren't we getting better error checking / 
debugging 
facilities for Struts?"

It would be amiss of me to say Struts alone is responsible here, we should 
include 
Tomcat, MySQL, Connector/J, JSP, Java.  And I'm not saying everybody is doing a 
terrible job, just asking whether we need to refocus our development efforts.

I'm not a fan of Microsoft but at least they have somebody that makes those 
decisions 
and they appear to be developing their technology for productivity.  They have 
documentation.  They have tutorials.  They have backward compatibility.  And, 
have 
you noticed how many websites are using .NET technology!  The number seems to 
growing much faster than J2EE or JEE.

When I was looking for an ISP to host my Struts application I found many more 
companies providing Microsoft servers with .NET than Unix/Linux servers with 
the 
necessary version of Tomcat or JBoss.

If I were to write a web product to be sold and run inhouse, I would probably 
develop it 
using Microsoft technology, it's just so much easier to say, "requires IIS 6+ 
and 
SQLserver 2005+" and know that it will work.  If you had to ship your product 
how many 
technologies with specific versions would you have to list?

Is Struts in danger of becoming just an academic exercise?  If Struts is going 
to be 
productive then we need to see:
*   more documentation (and I'm not talking about the API, I'm sick of trying 
to read the 
API and guess the usage of the taglib functions) plus tutorials, online 
training etc, 
*   more tools for building our applications (I know there are some but I'm on 
NetBeans 
and it appears to be lagging behind, Eclipse and Exadel I found to be too 
inflexible),
*   more error checking of the configuration files and better error messages 
indicating 
what the real problem is, maybe even warnings before the program runs,
*   more debugging utilities (spying on the http conversations and being able 
to 
examine the contents of our beans),
*   more backward compatibility so that I don't have to spend hours upgrading 
my app 
when my server updates or I move to a new server,
*   more stability in the platform we choose (with reference to the recent 
Tomcat bugs 
that were brought to the attention of this list).

If I were asked to vote it would probably be a conservative vote to consolidate 
our 
current technologies with better tools and a better product.

Okay, there, I said it.  It's out of my system and open for discussion.
Kind regards
mc



On 9 Sep 2005 at 19:39, Don Brown wrote:

> Heh, well, I can assure you I for one have my doubts :) Shale is one of the 
> more interesting developments in Struts and certainly deserved a few slides. 
> My goal was not to promote Shale as the future, but provide a snapshot of 
> the many growth areas within Struts, Shale included. I wanted to say more 
> about a new development I'm personally more interested in, Struts Ti, but it 
> isn't to the level of maturity and acceptance as Shale so it was relegated 
> to a single bullet.
> 
> Don
> 
> On 9/9/05,  $BNB_[>l (B <[EMAIL PROTECTED]> wrote:
> > 
> > Don
> > 
> > I have read your presentation.
> > I give me an impression.
> > 
> > Shale is the future of Struts without doubt!!!
> > 
> > 
> > 
> > 2005/9/8, Don Brown <[EMAIL PROTECTED]>:
> > > I just finished giving a presentation titled "Struts 1.3 and Beyond" to 
> > the
> > > Silicon Valley Web Developer JUG that I thought folks on this list might 
> > be
> > > interested in. In addition to the regular slide keyboard controls, press 
> > "T"
> > > to toggle the outline/printable view which contains extra notes.
> > >
> > > Presentation: http://www

Re: "Struts 1.3 and Beyond" Presentation

2005-09-09 Thread Craig McClanahan
On 9/9/05, Don Brown <[EMAIL PROTECTED]> wrote:
> 
> Heh, well, I can assure you I for one have my doubts :) Shale is one of 
> the
> more interesting developments in Struts and certainly deserved a few 
> slides.
> My goal was not to promote Shale as the future, but provide a snapshot of
> the many growth areas within Struts, Shale included. I wanted to say more
> about a new development I'm personally more interested in, Struts Ti, but 
> it
> isn't to the level of maturity and acceptance as Shale so it was relegated
> to a single bullet.


For those interested in compare-and-contrast on various web frameworks 
(primarily ones already in fairly widespread use), you might also be 
interested in the slides for my presentation (on that subject) at O'Reilly 
Open Source last month:

http://people.apache.org/~craigmcc/oscon_2005_web_architectures.pdf

One of the things I tried to do here was identify the key architectural 
decisions that a framework designer focuses on, and how several existing 
frameworks deal with those decisions.

Don


Craig


On 9/9/05, 梁炳場 <[EMAIL PROTECTED]> wrote:
> >
> > Don
> >
> > I have read your presentation.
> > I give me an impression.
> >
> > Shale is the future of Struts without doubt!!!
> >
> >
> >
> > 2005/9/8, Don Brown <[EMAIL PROTECTED]>:
> > > I just finished giving a presentation titled "Struts 1.3 and Beyond" 
> to
> > the
> > > Silicon Valley Web Developer JUG that I thought folks on this list 
> might
> > be
> > > interested in. In addition to the regular slide keyboard controls, 
> press
> > "T"
> > > to toggle the outline/printable view which contains extra notes.
> > >
> > > Presentation: http://www.twdata.org/presentations/struts-future/
> > > Presentation software: http://www.meyerweb.com/eric/tools/s5/
> > >
> > > Don
> > >
> > >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
>


Re: "Struts 1.3 and Beyond" Presentation

2005-09-09 Thread Don Brown
Heh, well, I can assure you I for one have my doubts :) Shale is one of the 
more interesting developments in Struts and certainly deserved a few slides. 
My goal was not to promote Shale as the future, but provide a snapshot of 
the many growth areas within Struts, Shale included. I wanted to say more 
about a new development I'm personally more interested in, Struts Ti, but it 
isn't to the level of maturity and acceptance as Shale so it was relegated 
to a single bullet.

Don

On 9/9/05, 梁炳場 <[EMAIL PROTECTED]> wrote:
> 
> Don
> 
> I have read your presentation.
> I give me an impression.
> 
> Shale is the future of Struts without doubt!!!
> 
> 
> 
> 2005/9/8, Don Brown <[EMAIL PROTECTED]>:
> > I just finished giving a presentation titled "Struts 1.3 and Beyond" to 
> the
> > Silicon Valley Web Developer JUG that I thought folks on this list might 
> be
> > interested in. In addition to the regular slide keyboard controls, press 
> "T"
> > to toggle the outline/printable view which contains extra notes.
> >
> > Presentation: http://www.twdata.org/presentations/struts-future/
> > Presentation software: http://www.meyerweb.com/eric/tools/s5/
> >
> > Don
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>


Re: "Struts 1.3 and Beyond" Presentation

2005-09-09 Thread 梁炳場
Don

I have read your presentation.
I give me an impression. 

Shale is the future of Struts without doubt!!!



2005/9/8, Don Brown <[EMAIL PROTECTED]>:
> I just finished giving a presentation titled "Struts 1.3 and Beyond" to the
> Silicon Valley Web Developer JUG that I thought folks on this list might be
> interested in. In addition to the regular slide keyboard controls, press "T"
> to toggle the outline/printable view which contains extra notes.
> 
> Presentation: http://www.twdata.org/presentations/struts-future/
> Presentation software: http://www.meyerweb.com/eric/tools/s5/
> 
> Don
> 
>

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



Re: [Shale] First shot at writing a "Shale filter"

2005-09-09 Thread gramani
Craig McClanahan <[EMAIL PROTECTED]> wrote on 09/09/2005 05:08:47 PM:

> > 
> > 
> First, you put your exclude patterns for /index.jsp and /logon.faces on 
the 
> *second* command rather than the first, so they weren't rejected by the 
> initial filter.
> 
> Second, not rejecting those patterns in the first filter is actually a 
good 
> thing :-). Otherwise, nobody would ever be able to log in to your app.
> 
> What you'll want to do is put some conditional logic that checks the 
path of 
> the current page inside your execute method that skips the test for 
those 
> pages.
> 
> Craig

I know, I was being an idiot. I had assumed (wrongly naturally) what 
"includes" and "excludes" meant. In my mind, I assumed it meant something 
like "for pages that follow the "includes" pattern, but not the "exclude" 
pattern, use the accept method in the filter (represnted by the class) to 
decide what to do... don't know if I'm explaining my misunderstanding just 
right. ..ok, never mind... :)

Anyways, after I burrowed into the code I did see I was way wrong in my 
assumption. I am glad to see what you said because it was sort of what i 
thought may be what i had to do. Once I do get this right, i shall post my 
code and maybe some other poor soul can stop tearing hair from head..:)

Just one thing though, and this may just be something to do with docs is 
all, AbstractRegExpFilter.java says: "If there are any include patterns, 
and the value matches one of
 * these patterns, call accept() and return
 * false to indicate request processing should continue."

However, the execute method has this code:
// Check for a match on the included list
if (matches(value, includesPatterns, true)) {
if (log.isTraceEnabled()) {
log.trace("  accept(include)");
}
accept(webContext);
return false;
}

I am wondering if you don't want if (matches(value, includesPatterns, 
false)) instead..? Since the comment says *if* there are include patterns 
etc.. I mean therefore if there is an empty includes pattern this should 
not be the case maybe..? just wondering.. obviously I don't know for sure 
at all what the intent was.:)

Yet once again, thank you. I still dream of the day when maybe I won't 
need this much hand holding.:)
Geeta


how to write cookie from a Struts jsp file

2005-09-09 Thread Legolas Woodland
Hi
Thank you for reading my post.
How i can write a cookie from a Struts jsp file into client system ?
I mean when user pressed sub,it button i write the cookie 
in a way that i can use it within
logic:present
and logic:notPresents 
tags .


Re: [Shale] First shot at writing a "Shale filter"

2005-09-09 Thread Craig McClanahan
On 9/9/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> 
> So. I am trying to write a Shale filter. This is how my chain.config.xml
> looks like:
> 
> 
> 
> 
>  "org.apache.shale.application.ContextRelativePathFilter"
> includes=
> "\S*\.faces,\S*\.html,\S*\.gif,\S*\.jpg,/index\.jsp"
> excludes="\S*\.jsp,\S*\.jspf"/>
> 
>  "com.intellicare.shaleNShark.application.PreprocessFilter"
> excludes="/index\.jsp,/logon.faces"/>
> 
> 
> 
> My PreprocessFilter extends ContextRelativePathFilter and has the foll.
> accept method:
> public void accept(ShaleWebContext context) throws Exception {
> 
> ShaleWebContext webContext = (ShaleWebContext) context;
> String value = value(webContext);
> Map sessionScope = webContext.getSessionScope();
> String user = (String) sessionScope.get("user");
> String pw = (String) sessionScope.get("password");
> //..etc. (the idea of course being if un/pw are
> null/empty, the app gets seriously mad..)
> }
> 
> From what I can understand of the code in AbstractRegExpFilter,
> implementing the "value" method will decide how the "includes" and
> "excludes" patterns are understood by Shale. Since I extended
> ContextRelativePathFilter, I would have thought that my /index.jsp as well
> as /logon.faces would *not* make it to the PreprocessFilter. But I have a
> breakpoint in the accept method and sadly *every* page seems to go through
> this accept method. (What's more, the value of the String "value" above
> comes out as "/index.jsp" and "/logon.faces" when I access my index page
> and logon pages.) Which of course is not ok since I shouldn't be checking
> for un/pw values in the logon page. Where am I going wrong?
> 
> Thank you again for your continued help.. doubtless this must be big time
> boring for you..
> Geeta
> 
> 
First, you put your exclude patterns for /index.jsp and /logon.faces on the 
*second* command rather than the first, so they weren't rejected by the 
initial filter.

Second, not rejecting those patterns in the first filter is actually a good 
thing :-). Otherwise, nobody would ever be able to log in to your app.

What you'll want to do is put some conditional logic that checks the path of 
the current page inside your execute method that skips the test for those 
pages.

Craig


ot: struts obsesed

2005-09-09 Thread Vic Cekvenich

http://jroller.com/page/RickHigh?entry=is_struts_dead_is_struts

Is he going to get over it?
I wonder who the #2 framework is?

.V


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



[Shale] First shot at writing a "Shale filter"

2005-09-09 Thread gramani
So. I am trying to write a Shale filter. This is how my chain.config.xml 
looks like:




  
 
  

  

My PreprocessFilter extends ContextRelativePathFilter and has the foll. 
accept method:
public void accept(ShaleWebContext context) throws Exception {

ShaleWebContext webContext = (ShaleWebContext) context;
String value = value(webContext);
Map sessionScope = webContext.getSessionScope();
String user = (String) sessionScope.get("user");
String pw = (String) sessionScope.get("password");
//..etc. (the idea of course being if un/pw are 
null/empty, the app gets seriously mad..)
}

>From what I can understand of the code in AbstractRegExpFilter, 
implementing the "value" method will decide how the "includes" and 
"excludes" patterns are understood by Shale. Since I extended 
ContextRelativePathFilter, I would have thought that my /index.jsp as well 
as /logon.faces would *not* make it to the PreprocessFilter. But I have a 
breakpoint in the accept method and sadly *every* page seems to go through 
this accept method. (What's more, the value of the String "value" above 
comes out as "/index.jsp" and "/logon.faces" when I access my index page 
and logon pages.) Which of course is not ok since I shouldn't be checking 
for un/pw values in the logon page. Where am I going wrong?

Thank you again for your continued help.. doubtless this must be big time 
boring for you..
Geeta


Re: SingleSignOn for struts based app with SiteMinder

2005-09-09 Thread Joe Germuska
I have developed a few applications using SiteMinder, but none where 
my site was responsible for authenticating the user.  I believe that 
you are likely a victim of the inflexibility of the container based 
security specifications.


If you need a login to be effected within your container without an 
additional prompt to the user, odds are good that you need to install 
some kind of extension to the container based security for your 
Servlet Container.  Maybe Netegrity has something like this?


Joe



At 1:50 PM -0500 9/9/05, [EMAIL PROTECTED] wrote:

Hi !
Ours is a struts based application and uses container based security. I
want to protect the application site by Site Minder and enable single sign
on for this application.

The application uses j_security_check and userPrincipal object in the
authentication mechanism.  What can I do to make the application auto-login
the user once it has passed SiteMinder authentication ?

Thanks
-abhay
_
This e-mail transmission and any attachments to it are intended solely for
the use of the individual or entity to whom it is addressed and may contain
confidential and privileged information.  If you are not the intended
recipient, your use, forwarding, printing, storing, disseminating,
distribution, or copying of this communication is prohibited.  If you
received this communication in error, please notify the sender immediately
by replying to this message and delete it from your computer.


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



--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex


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



SingleSignOn for struts based app with SiteMinder

2005-09-09 Thread abhay . b . chaware

Hi !
Ours is a struts based application and uses container based security. I
want to protect the application site by Site Minder and enable single sign
on for this application.

The application uses j_security_check and userPrincipal object in the
authentication mechanism.  What can I do to make the application auto-login
the user once it has passed SiteMinder authentication ?

Thanks
-abhay

_
This e-mail transmission and any attachments to it are intended solely for
the use of the individual or entity to whom it is addressed and may contain
confidential and privileged information.  If you are not the intended
recipient, your use, forwarding, printing, storing, disseminating,
distribution, or copying of this communication is prohibited.  If you
received this communication in error, please notify the sender immediately
by replying to this message and delete it from your computer.


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



RE: Nested error

2005-09-09 Thread Wiebe de Jong
I am definitely using session scope.

Struts-config snippet:

  
  
  
  
  
  

Action snippet:

private ActionForward doProductSetUpdate(ActionMapping mapping,
ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws
Exception {
log.debug(":doProductSetUpdate");
HttpSession session = request.getSession();
// get productSetID from parameter
String productSetIDstr = request.getParameter("productSetID");
int productSetID = ((productSetIDstr == null) ? 0 :
Integer.parseInt(productSetIDstr));
// get set
ProductBD productBD = new ProductBD();
ProductSetWithItems setWithItems =
productBD.findSetByIDWithItems(productSetID);
// save set in session
session.setAttribute("productSetWithItems", setWithItems);
// update form
ProductSetForm productSetForm = (ProductSetForm) form;
BeanUtils.copyProperties(productSetForm, setWithItems);
// Forward control to the success URI specified in struts-config.xml
return (mapping.findForward("success"));
}

Does BeanUtils.copyProperties do a shallow or deep copy? Also, it is copying
from an ArrayList to a Collection.

Wiebe

-Original Message-
From: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 09, 2005 11:18 AM
To: Struts Users Mailing List
Subject: Re: Nested error

It was initialized when JSP was prepared, then response was returned
to the browser. If you use formbean with request scope, it is gone.
When you hit the submit button, you initiate new request, it which the
form is recreated, and this field may not be initialized.

So, the fact that you were able to render a page means nothing, if you
use request scope for formbean. Use session scope or reinitialize
formbean each time. Caution: if you use request scope, then reset()
may be not called (not sure on that), so initialize the form in the
consructor.

Michael.

On 9/9/05, Wiebe de Jong <[EMAIL PROTECTED]> wrote:
> Michael,
> 
> The collection was initialized. In fact, it had several items in it and
the
> form had successfully displayed, as I mentioned.
> 
> The error occurs when I hit the submit button, whether I changed any
values
> or not.
>
>>   >   ...
>>   IndexOutOfBoundsException: Index: 0, Size: 0
>>   ...
>>   private Collection items; <--- null

-
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]



SingleSignOn for struts based app with SiteMinder

2005-09-09 Thread abhay . b . chaware

Hi !
Ours is a struts based application and uses container based security. I
want to protect the application site by Site Minder and enable single sign
on for this application.

The application uses j_security_check and userPrincipal object in the
authentication mechanism.  What can I do to make the application auto-login
the user once it has passed SiteMinder authentication ?

Thanks
-abhay
_
This e-mail transmission and any attachments to it are intended solely for
the use of the individual or entity to whom it is addressed and may contain
confidential and privileged information.  If you are not the intended
recipient, your use, forwarding, printing, storing, disseminating,
distribution, or copying of this communication is prohibited.  If you
received this communication in error, please notify the sender immediately
by replying to this message and delete it from your computer.


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



Re: Nested error

2005-09-09 Thread Michael Jouravlev
It was initialized when JSP was prepared, then response was returned
to the browser. If you use formbean with request scope, it is gone.
When you hit the submit button, you initiate new request, it which the
form is recreated, and this field may not be initialized.

So, the fact that you were able to render a page means nothing, if you
use request scope for formbean. Use session scope or reinitialize
formbean each time. Caution: if you use request scope, then reset()
may be not called (not sure on that), so initialize the form in the
consructor.

Michael.

On 9/9/05, Wiebe de Jong <[EMAIL PROTECTED]> wrote:
> Michael,
> 
> The collection was initialized. In fact, it had several items in it and the
> form had successfully displayed, as I mentioned.
> 
> The error occurs when I hit the submit button, whether I changed any values
> or not.
>
>>   >   ...
>>   IndexOutOfBoundsException: Index: 0, Size: 0
>>   ...
>>   private Collection items; <--- null

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



Re: Nested error

2005-09-09 Thread Rick Reumann

Wiebe de Jong wrote the following on 9/9/2005 1:58 PM:

Michael,

The collection was initialized. In fact, it had several items in it and the
form had successfully displayed, as I mentioned.

The error occurs when I hit the submit button, whether I changed any values
or not.


But are you re-intializing them. If  you aren't using a Session scoped 
form or some lazyList type of Collection you need to make sure the 
Collection is the correct size when you hit submit.


More on it here http://wiki.apache.org/struts/StrutsCatalogLazyList

--
Rick

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



RE: Nested error

2005-09-09 Thread Wiebe de Jong
Michael,

The collection was initialized. In fact, it had several items in it and the
form had successfully displayed, as I mentioned.

The error occurs when I hit the submit button, whether I changed any values
or not.

Wiebe

-Original Message-
From: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 09, 2005 10:22 AM
To: Struts Users Mailing List
Subject: Re: Nested error

On 9/9/05, Wiebe de Jong <[EMAIL PROTECTED]> wrote:
> I just started using nested tags on a page, and when I submit it, Struts
> causes the following error:
> 
> HTTP ERROR: 503 Service Unavailable
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> RequestURI=/ecom/productSetUpdateSubmit.do
> 
> This happens before even getting to my action. The form is displayed
> correctly with several items in the collection.
> 
> JSP snippet:
> 
>  type="com.mycompany.ecom.dao.ProductSetItem">
> 
>   Item:
>styleClass="form"/>
>styleClass="form"/>
> 
> 
> 
> Form snippet:
> 
> private Collection items;
> public Collection getItems() { return items; }
> public void setItems(Collection items) { this.items = items; }
> 
> 
> I'm running Struts 1.1 on JBoss-2.4.3_Jetty-3.1.3-1 with JDK 1.3.1_11
> 
> Any ideas? 

   How do I get past this problem?

Initializing "items" might help.

Michael.

-
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: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Craig McClanahan
On 9/9/05, Rick Reumann <[EMAIL PROTECTED]> wrote:
> 
> Craig McClanahan wrote the following on 9/9/2005 12:18 PM:
> 
> > For Shale in particular, the "application controller" part of Shale is
> > implemented as a Commons Chain chain (similar in spirit to what's going 
> on
> > with Struts 1.3's request processor), so you can also implement a check 
> like
> > this as one of the commands that gets executed on every request. To set 
> up
> > such commands, simply configure a chain named "preprocess" in catalog
> > "shale" and it will get executed for you on every request.
> 
> Is there a particular example that demonstrates this in the shale
> examples. I see the chain-config.xml listed so would the set up for our
> apps just need to ..
> 
> 1) Include shale jars
> 
> 2) create chain-config.xml
> 
> 
> 
> 
> 
> 
> 
>  className="org.apache.shale.application.ContextRelativePathFilter"
> 
> includes="\S*\.faces,\S*\.html,\S*\.gif,\S*\.jpg,/index\.jsp"
> excludes="\S*\.jsp,\S*\.jspf"/>
> 
> 
> 
> ...
> 


The code above is quoted from the Shale "use cases" example, and illustrates 
how you can disallow direct access to a JSP page. 

3) we would provide a ContextRelativePathFilter class (Is this just a
> standard class implementing Filter?)


"Use the source, Luke" :-)

No, it doesn't implement javax.servlet.Filter ... it implements 
org.apache.commons.chain.Command. This is a Shale-specific *alternative* to 
using servlet filters.

Another dumb question since I'm new to using this chain of command set
> up... If I wanted other Filters to fire in the preprocess based on other
> include/exclude pattern matching, would I just include another command
> right beneath (using this example above) the ContextRelativePathFilter
> command?


Yes ... the commands are fired the order they are configured in the chain. 

If so, does the chain break as soon as the first pattern match
> is found and that filter executes or does it continue to try to match
> the patterns in other commands?


Chain "breakage" is triggered by a command that returns true instead of 
false from its execute() method. If you do this, the normal JSF processing 
for the request will not happen, so you had better have completed the 
response yourself. In the particular case of this filter, there are two 
possible outcomes:

* Don't break the chain -- calls the accept() method from 
AbstractRegExpFilter,
which does nothing by default, then return false so that the chain will 
continue.

* Break the chain -- calls the reject() method from AbstractRegExpFilter,
which sends an HTTP "forbidden" message by default, then return true so that
the chain will stop.

If you decide to break the chain, that means the normal JSF lifecycle won't 
happen ... so it is up to you to complete the HTTP response instead. If you 
were using servlet filters to implement this functionality, you would 
accomplish the same thing by simply *not* calling chain.doFilter() to pass 
the request on.

Thanks
> 
> 
> --
> Rick


Craig


Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Gary VanMatre
This is another example: 
http://svn.apache.org/viewcvs.cgi/struts/shale/trunk/clayplugin/src/java/org/apache/shale/clay/faces/ClayViewHandlerCommand.java?view=markup

The only requirement is that the command's implement the Command interface.  
The common chains is a pretty sweet idea 
(http://jakarta.apache.org/commons/chain/).  It's a utility/pattern that can be 
used in any tier of an application.  The Struts 1.3 request processor has been 
re-tooled to use chains (I wish I could get my employer to move from Struts 1.1 
:--)  

If a Command implementation returns "true" from the execute method, the chain 
is stopped.  You will need to consider that when deciding what order the 
"preprocess" commands should be ordered.

Gary   




--- Begin Message ---
Rick Reumann <[EMAIL PROTECTED]> wrote on 09/09/2005 12:36:39 PM:

> Craig McClanahan wrote the following on 9/9/2005 12:18 PM:
> 
> > For Shale in particular, the "application controller" part of Shale is 

> > implemented as a Commons Chain chain (similar in spirit to what's 
going on 
> > with Struts 1.3's request processor), so you can also implement a 
> check like 
> > this as one of the commands that gets executed on every request. To 
set up 
> > such commands, simply configure a chain named "preprocess" in catalog 
> > "shale" and it will get executed for you on every request.
> 
> Is there a particular example that demonstrates this in the shale 
> examples. I see the chain-config.xml listed so would the set up for our 
> apps just need to ..
> 
> 
> 3) we would provide a ContextRelativePathFilter class (Is this just a 
> standard class implementing Filter?)
> 

Rick, here's where you can see the src for this class:
struts-shale-core-library\src\java\org\apache\shale\application
So ContextRelativePathFilter extends AbstractRegExpFilter which implements 
org.apache.commons.chain.Command ..which i nothing about (sigh..)

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

Re: Nested error

2005-09-09 Thread Michael Jouravlev
On 9/9/05, Wiebe de Jong <[EMAIL PROTECTED]> wrote:
> I just started using nested tags on a page, and when I submit it, Struts
> causes the following error:
> 
> HTTP ERROR: 503 Service Unavailable
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> RequestURI=/ecom/productSetUpdateSubmit.do
> 
> This happens before even getting to my action. The form is displayed
> correctly with several items in the collection.
> 
> JSP snippet:
> 
>  type="com.mycompany.ecom.dao.ProductSetItem">
> 
>   Item:
>styleClass="form"/>
>styleClass="form"/>
> 
> 
> 
> Form snippet:
> 
> private Collection items;
> public Collection getItems() { return items; }
> public void setItems(Collection items) { this.items = items; }
> 
> 
> I'm running Struts 1.1 on JBoss-2.4.3_Jetty-3.1.3-1 with JDK 1.3.1_11
> 
> Any ideas? 

   How do I get past this problem?

Initializing "items" might help.

Michael.

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



RE: JSF -> Shale transition

2005-09-09 Thread Walton, Kaleb \(ISS Southfield\)
I should've shut my mouth earlier :). 

Kaleb 

-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 09, 2005 12:18 PM
To: Struts Users Mailing List
Subject: Re: JSF -> Shale transition

I prefer to do all my webapps in Assembly running on dedicated hardware
with no OS at all.

Beat *THAT* performance! ;)

Frank

Gary VanMatre wrote:
>>What do you mean by "inferior if you are interested in performance". 
>>Is the overhead of the dialog/navigation processing pretty high?
>>
> 
> 
> In perspective, vanilla servlet programming is faster than Struts.  
> 
> Isn't it relative to what you *value* in a web framework. 
> 
> Gary
> 
> 
> 
>>-Original Message-
>>From: Dakota Jack [mailto:[EMAIL PROTECTED]
>>Sent: Thursday, September 08, 2005 4:19 PM
>>To: Struts Users Mailing List
>>Subject: Re: JSF -> Shale transition
>>
>>Well, have you considered classic struts?  Shale is really meant for 
>>people who are trying to change an application from JSF to Struts, and

>>not everyone, including myself, think this is a good idea.  Shale is 
>>not Struts improved but a transition to something entirely different, 
>>and inferior in my opinion, if you are interested in performance.
>>
>>On 9/8/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:
>>
>>>We're wanting to go from our home-brewed method of interaction using 
>>>jsps and servlets that are not very consistent in their expression 
>>>(other than the general jsp/servlet specs) to something that defines 
>>>interactions more concretely. Our current frustrations include form 
>>>handling, page transitions, forwarding, etc.
>>>
>>>Regards,
>>>Kaleb
>>>
>>>-Original Message-
>>>From: Dakota Jack [mailto:[EMAIL PROTECTED]
>>>Sent: Thursday, September 08, 2005 12:44 AM
>>>To: Struts Users Mailing List; [EMAIL PROTECTED]
>>>Subject: Re: JSF -> Shale transition
>>>
>>>Moving from Struts to JSF is moving to a "more defined" framework?
>>>That is pretty difficult to grasp.  Could you explain?
>>>
>>>
>>>
>>>On 9/6/05, Craig McClanahan <[EMAIL PROTECTED]> wrote:
>>>
On 9/6/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:

>Hey all,
>
>As I had mentioned in a previous post, our team is looking to move
>>
>towards a more well defined web framework. From my limited 
>experience using Shale (ran the shale-use-cases) I'm not feeling 
>very confident that we could use it *right away*.
>
>I wanted to ask for opinions on what would be a gradual step for us

>to take towards the Shale framework (once it's stable enough to
>>
>use in a production environment). For example, would JSF + Spring 
>be a good combo that would make for an easy transition to Shale?
>Struts +
>>>
>WebFlow + Spring? Etc..
>
>Do the aforementioned framework combinations even matter? Will 
>Shale
>>>
>just add another layer on top or glue together with what we would 
>have already developed? Although I've been reading up on Shale 
>quite
>>>
>a bit, my understanding is still limited so please excuse me if 
>these questions are easily found through already documented
>>
>>sources.
>>
>If they are, please share where they can be found :)



The key to choosing a transition approach is what you want to use 
for the "front controller" part of your architecture durng the 
interim. If
>>>
you're starting from Struts, a straightforward path would be to use 
the integration library to start switching your pages to using JSF 
components instead of Struts HTML tags (without having to modify 
your actions), followed by a migration of the back-end logic to 
using JSF's
>>>
front controller and request processing lifecycle.

If, on the other hand, you decide to commit to JSF's controller 
early rather than late, you might as well just use Shale along with 
it from the beginning. Unlike the way that other frameworks deal 
with JSF, Shale
*assumes* you will be using the JSF controller architecture, and it 
just adds ease of use around problems you'll face anyway. It doesn't
>>
try to treat JSF as purely a component architecture.

Craig McClanahan

Regards,

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

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.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]



Nested error

2005-09-09 Thread Wiebe de Jong
I just started using nested tags on a page, and when I submit it, Struts
causes the following error:

HTTP ERROR: 503 Service Unavailable
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
RequestURI=/ecom/productSetUpdateSubmit.do

This happens before even getting to my action. The form is displayed
correctly with several items in the collection.

JSP snippet:



  Item:
  
  



Form snippet:

private Collection items;
public Collection getItems() { return items; }
public void setItems(Collection items) { this.items = items; }


I'm running Struts 1.1 on JBoss-2.4.3_Jetty-3.1.3-1 with JDK 1.3.1_11

Any ideas? How do I get past this problem?

Wiebe


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



RE:

2005-09-09 Thread Enda Dowling
Hey,
  I got it working by using a Meta tag to forward it to the right URL.
Thanks for the email though 
Enda

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: 09 September 2005 02:52
To: user@struts.apache.org
Subject: Re: 

Enda Dowling wrote:
> Does anyone know is there a way to call an action from a page without
> anything being pressed on the page. Pretty much it is just a temp page to
> forward onto an action.
> 
> I tried a few things like the one below but nothing has worked so far.
> 
> 

What error do you get with the above? If holiday.do is a valid action, 
and assuming your JSP doesn't generate response text before the redirect 
tag is reached, it should work fine.

Try posting relevant parts of your struts-config.xm and JSP file and the 
error(s) you get.

L.


-
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: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
Rick Reumann <[EMAIL PROTECTED]> wrote on 09/09/2005 12:36:39 PM:

> Craig McClanahan wrote the following on 9/9/2005 12:18 PM:
> 
> > For Shale in particular, the "application controller" part of Shale is 

> > implemented as a Commons Chain chain (similar in spirit to what's 
going on 
> > with Struts 1.3's request processor), so you can also implement a 
> check like 
> > this as one of the commands that gets executed on every request. To 
set up 
> > such commands, simply configure a chain named "preprocess" in catalog 
> > "shale" and it will get executed for you on every request.
> 
> Is there a particular example that demonstrates this in the shale 
> examples. I see the chain-config.xml listed so would the set up for our 
> apps just need to ..
> 
> 
> 3) we would provide a ContextRelativePathFilter class (Is this just a 
> standard class implementing Filter?)
> 

Rick, here's where you can see the src for this class:
struts-shale-core-library\src\java\org\apache\shale\application
So ContextRelativePathFilter extends AbstractRegExpFilter which implements 
org.apache.commons.chain.Command ..which i nothing about (sigh..)

Geeta


Re: Validation :: best practice?

2005-09-09 Thread Michael Jouravlev
On 9/9/05, emre akbas <[EMAIL PROTECTED]> wrote:
> Hi,
> I want to know what the state-of-the-art practices about Struts validation
> are.

Try these:
  https://strutslive.dev.java.net
  https://formdef.dev.java.net

> It is well-known that there are some problems in automatic validation.
> Here is a good article:
> http://www.reumann.net/struts/articles/request_lists.jsp Are the ideas in
> this article obsolete?

No more obsolete than Struts itself. Anyway, because I try to keep all
action-related stuff in the ActionForm, I never encountered the issue
of losing request-scoped objects. It seems a little strange to me,
that request-scoped objects are lost on forward, which happens on the
server.

> As far as I understand, the best practice is calling the validate() method
> manually. This requires that we write ... validate="false" ... in the
> action-mapping definition. However, if we do this, we cannot use javascript
> (client-size) validation. I want to use javascript validation. What are the
> possible solutions?

Struts cannot decide whether the tags should or should not generate
client-side validation javascript in the JSP pages belonging to an
action, simply because Struts does not have the notion of a JSP page
"belonging" to a certain action class. Actions and pages are
interlaced in a chain fashion and generally you don't know which
action the data from a page will be submitted to.

Therefore client-side validation is set separately with
 tag on JSP page, while automatic server-side
validation is set with validate="true" in the action mapping
definition.

Michael.

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



Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Rick Reumann

Craig McClanahan wrote the following on 9/9/2005 12:18 PM:

For Shale in particular, the "application controller" part of Shale is 
implemented as a Commons Chain chain (similar in spirit to what's going on 
with Struts 1.3's request processor), so you can also implement a check like 
this as one of the commands that gets executed on every request. To set up 
such commands, simply configure a chain named "preprocess" in catalog 
"shale" and it will get executed for you on every request.


Is there a particular example that demonstrates this in the shale 
examples. I see the chain-config.xml listed so would the set up for our 
apps just need to ..


1) Include shale jars

2) create chain-config.xml



  
  


  className="org.apache.shale.application.ContextRelativePathFilter"


includes="\S*\.faces,\S*\.html,\S*\.gif,\S*\.jpg,/index\.jsp"
 excludes="\S*\.jsp,\S*\.jspf"/>

  

...


3) we would provide a ContextRelativePathFilter class (Is this just a 
standard class implementing Filter?)



Another dumb question since I'm new to using this chain of command set 
up... If I wanted other Filters to fire in the preprocess based on other 
include/exclude pattern matching, would I just include another command 
right beneath (using this example above) the ContextRelativePathFilter 
command? If so,  does the chain break as soon as the first pattern match 
is found and that filter executes or does it continue to try to match 
the patterns in other commands?


Thanks


--
Rick

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



Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
Gary, Rick, Craig: thanks very much!
Geeta


Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Craig McClanahan
On 9/9/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> 
> Rick Reumann <[EMAIL PROTECTED]> wrote on 09/09/2005 12:01:48 PM:
> 
> >
> > I would think JSF could use regular servlet filters? If so, that's where
> 
> > I'd do stuff that you want checked on almost every request. Even in
> > Struts, I wouldn't touch the RequestProcessor. Use a ServletFilter.
> 
> oh yes, correct! I do remember writing those when I worked with Struts..
> This is in fact what I meant..:)
> 
> They
> > are easy to set up and I'll provide an example if you want one. I'm not
> > sure of the implications of using them with JSF, but I'm sure they could
> 
> > be used.
> 
> Yes, those implications you mentioned are I guess what I'm wondering
> about.. (thanks for articulating it for me..;))


A servlet filter is definitely usable with JSF (and therefore with Shale), 
and is an appropriate solution to this problem, just like it is for a Struts 
1.x application.

For Shale in particular, the "application controller" part of Shale is 
implemented as a Commons Chain chain (similar in spirit to what's going on 
with Struts 1.3's request processor), so you can also implement a check like 
this as one of the commands that gets executed on every request. To set up 
such commands, simply configure a chain named "preprocess" in catalog 
"shale" and it will get executed for you on every request.

>
> > --
> > Rick
> 
> Geeta
> 
> Craig


Re: JSF -> Shale transition

2005-09-09 Thread Frank W. Zammetti
I prefer to do all my webapps in Assembly running on dedicated hardware 
with no OS at all.


Beat *THAT* performance! ;)

Frank

Gary VanMatre wrote:

What do you mean by "inferior if you are interested in performance". Is
the overhead of the dialog/navigation processing pretty high? 




In perspective, vanilla servlet programming is faster than Struts.  

Isn't it relative to what you *value* in a web framework. 


Gary




-Original Message-
From: Dakota Jack [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 08, 2005 4:19 PM

To: Struts Users Mailing List
Subject: Re: JSF -> Shale transition

Well, have you considered classic struts?  Shale is really meant for
people who are trying to change an application from JSF to Struts, and
not everyone, including myself, think this is a good idea.  Shale is not
Struts improved but a transition to something entirely different, and
inferior in my opinion, if you are interested in performance.

On 9/8/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:

We're wanting to go from our home-brewed method of interaction using 
jsps and servlets that are not very consistent in their expression 
(other than the general jsp/servlet specs) to something that defines 
interactions more concretely. Our current frustrations include form 
handling, page transitions, forwarding, etc.


Regards,
Kaleb

-Original Message-
From: Dakota Jack [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 08, 2005 12:44 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: JSF -> Shale transition

Moving from Struts to JSF is moving to a "more defined" framework?
That is pretty difficult to grasp.  Could you explain?



On 9/6/05, Craig McClanahan <[EMAIL PROTECTED]> wrote:


On 9/6/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:


Hey all,

As I had mentioned in a previous post, our team is looking to move


towards a more well defined web framework. From my limited 
experience using Shale (ran the shale-use-cases) I'm not feeling 
very confident that we could use it *right away*.


I wanted to ask for opinions on what would be a gradual step for 
us to take towards the Shale framework (once it's stable enough to


use in a production environment). For example, would JSF + Spring 
be a good combo that would make for an easy transition to Shale? 
Struts +



WebFlow + Spring? Etc..

Do the aforementioned framework combinations even matter? Will 
Shale


just add another layer on top or glue together with what we would 
have already developed? Although I've been reading up on Shale 
quite


a bit, my understanding is still limited so please excuse me if 
these questions are easily found through already documented


sources.


If they are, please share where they can be found :)




The key to choosing a transition approach is what you want to use 
for the "front controller" part of your architecture durng the 
interim. If


you're starting from Struts, a straightforward path would be to use 
the integration library to start switching your pages to using JSF 
components instead of Struts HTML tags (without having to modify 
your actions), followed by a migration of the back-end logic to 
using JSF's



front controller and request processing lifecycle.

If, on the other hand, you decide to commit to JSF's controller 
early rather than late, you might as well just use Shale along with 
it from the beginning. Unlike the way that other frameworks deal 
with JSF, Shale
*assumes* you will be using the JSF controller architecture, and it 
just adds ease of use around problems you'll face anyway. It doesn't



try to treat JSF as purely a component architecture.

Craig McClanahan

Regards,


Kaleb





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







--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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



Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Gary VanMatre

>Thanks for your response Gary. Maybe I misunderstand your suggestion, but 
>I think you are telling me how to get "userName". But here's my real 
>question: don't you end up writing code like:
>
>String userName = getBean("sessionScope.userName");
>if (userName == null) return "loggedOff";
>
>in *every* action method in *every* backing bean of the application? 
>
>So I want to know is there a good way to not have to write this so many 
>times (other than by extending AbstractViewController etc. as I mentioned 
>in my original note..)..? Am i not making sense..(:(

Oh, sorry.  I missed the topic.  A Shale "preprocess" filter command would be a 
good way to implement this assuming that you're using the 
ShaleApplicationFilter.   The filter command is an implementation of the chain 
Command interfaces.  The usecase has an example of how you would register a 
command. 

Take a look at the WEB-INF/chain-config.xml in the usecase's.

Gary  

>
>> 
>> Gary
>> 
>Thanks again,
>Geeta




--- Begin Message ---
[EMAIL PROTECTED] (Gary VanMatre) wrote on 09/09/2005 11:49:12 AM:

> There are several ways to handle this, maybe too many options:
> 
> From a view controller:
> 
>String userName = getBean("sessionScope.userName");

Thanks for your response Gary. Maybe I misunderstand your suggestion, but 
I think you are telling me how to get "userName". But here's my real 
question: don't you end up writing code like:

String userName = getBean("sessionScope.userName");
if (userName == null) return "loggedOff";

in *every* action method in *every* backing bean of the application? 

So I want to know is there a good way to not have to write this so many 
times (other than by extending AbstractViewController etc. as I mentioned 
in my original note..)..? Am i not making sense..(:(

> 
> Gary
> 
Thanks again,
Geeta
--- End Message ---
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: JSF -> Shale transition

2005-09-09 Thread Rick Reumann

Walton, Kaleb (ISS Southfield) wrote the following on 9/9/2005 9:17 AM:

What do you mean by "inferior if you are interested in performance". Is
the overhead of the dialog/navigation processing pretty high? 


Oh no:) Here we go again:)...

JSF sucks.
No, Sruts sucks.
Spring rules.
No, Spring sucks.
Your momma.
No, Your momma!
Tapestry baby.
blah.. WebWorks!
No way, .NET For the win!
.NET, you're crazy.
Cocoon and Echo framework is the best.
Come on Flash all the way.
Your momma again.


It's Friday right?:)

--
Rick

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



Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
Rick Reumann <[EMAIL PROTECTED]> wrote on 09/09/2005 12:01:48 PM:

> 
> I would think JSF could use regular servlet filters? If so, that's where 

> I'd do stuff that you want checked on almost every request. Even in 
> Struts, I wouldn't touch the RequestProcessor. Use a ServletFilter. 

oh yes, correct! I do remember writing those when I worked with Struts.. 
This is in fact what I meant..:)

They 
> are easy to set up and I'll provide an example if you want one. I'm not 
> sure of the implications of using them with JSF, but I'm sure they could 

> be used.

Yes, those implications you mentioned are I guess what I'm wondering 
about.. (thanks for articulating it for me..;))

> 
> -- 
> Rick

Geeta


Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
[EMAIL PROTECTED] (Gary VanMatre) wrote on 09/09/2005 11:49:12 AM:

> There are several ways to handle this, maybe too many options:
> 
> From a view controller:
> 
>String userName = getBean("sessionScope.userName");

Thanks for your response Gary. Maybe I misunderstand your suggestion, but 
I think you are telling me how to get "userName". But here's my real 
question: don't you end up writing code like:

String userName = getBean("sessionScope.userName");
if (userName == null) return "loggedOff";

in *every* action method in *every* backing bean of the application? 

So I want to know is there a good way to not have to write this so many 
times (other than by extending AbstractViewController etc. as I mentioned 
in my original note..)..? Am i not making sense..(:(

> 
> Gary
> 
Thanks again,
Geeta


RE: JSF -> Shale transition

2005-09-09 Thread Gary VanMatre
> What do you mean by "inferior if you are interested in performance". Is
> the overhead of the dialog/navigation processing pretty high? 
> 

In perspective, vanilla servlet programming is faster than Struts.  

Isn't it relative to what you *value* in a web framework. 

Gary


> -Original Message-
> From: Dakota Jack [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 08, 2005 4:19 PM
> To: Struts Users Mailing List
> Subject: Re: JSF -> Shale transition
> 
> Well, have you considered classic struts?  Shale is really meant for
> people who are trying to change an application from JSF to Struts, and
> not everyone, including myself, think this is a good idea.  Shale is not
> Struts improved but a transition to something entirely different, and
> inferior in my opinion, if you are interested in performance.
> 
> On 9/8/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:
> > We're wanting to go from our home-brewed method of interaction using 
> > jsps and servlets that are not very consistent in their expression 
> > (other than the general jsp/servlet specs) to something that defines 
> > interactions more concretely. Our current frustrations include form 
> > handling, page transitions, forwarding, etc.
> > 
> > Regards,
> > Kaleb
> > 
> > -Original Message-
> > From: Dakota Jack [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, September 08, 2005 12:44 AM
> > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > Subject: Re: JSF -> Shale transition
> > 
> > Moving from Struts to JSF is moving to a "more defined" framework?
> > That is pretty difficult to grasp.  Could you explain?
> > 
> > 
> > 
> > On 9/6/05, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> > > On 9/6/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hey all,
> > > >
> > > > As I had mentioned in a previous post, our team is looking to move
> 
> > > > towards a more well defined web framework. From my limited 
> > > > experience using Shale (ran the shale-use-cases) I'm not feeling 
> > > > very confident that we could use it *right away*.
> > > >
> > > > I wanted to ask for opinions on what would be a gradual step for 
> > > > us to take towards the Shale framework (once it's stable enough to
> 
> > > > use in a production environment). For example, would JSF + Spring 
> > > > be a good combo that would make for an easy transition to Shale? 
> > > > Struts +
> > 
> > > > WebFlow + Spring? Etc..
> > > >
> > > > Do the aforementioned framework combinations even matter? Will 
> > > > Shale
> > 
> > > > just add another layer on top or glue together with what we would 
> > > > have already developed? Although I've been reading up on Shale 
> > > > quite
> > 
> > > > a bit, my understanding is still limited so please excuse me if 
> > > > these questions are easily found through already documented
> sources.
> > 
> > > > If they are, please share where they can be found :)
> > >
> > >
> > >
> > > The key to choosing a transition approach is what you want to use 
> > > for the "front controller" part of your architecture durng the 
> > > interim. If
> > 
> > > you're starting from Struts, a straightforward path would be to use 
> > > the integration library to start switching your pages to using JSF 
> > > components instead of Struts HTML tags (without having to modify 
> > > your actions), followed by a migration of the back-end logic to 
> > > using JSF's
> > 
> > > front controller and request processing lifecycle.
> > >
> > > If, on the other hand, you decide to commit to JSF's controller 
> > > early rather than late, you might as well just use Shale along with 
> > > it from the beginning. Unlike the way that other frameworks deal 
> > > with JSF, Shale
> > > *assumes* you will be using the JSF controller architecture, and it 
> > > just adds ease of use around problems you'll face anyway. It doesn't
> 
> > > try to treat JSF as purely a component architecture.
> > >
> > > Craig McClanahan
> > >
> > > Regards,
> > > > Kaleb



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



Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Rick Reumann

[EMAIL PROTECTED] wrote the following on 9/9/2005 10:19 AM:

I can see myself doing this check many times in many methods in many 
backing beans (which extend AbstractViewController). What is the 
appropriate way to implement this check - or for that matter any other 
common code? I can of course extend AbstractViewController and write this 
method there and all my beans can call it... but I kind of think there 
must be a better way..? (Something like Struts' RequestProcessor..) I 
thought perhaps this may be where preprocess() can come in handy - 
however, that method returns void. Plus it is within each backing bean and 
not common to all backing beans..


I would think JSF could use regular servlet filters? If so, that's where 
I'd do stuff that you want checked on almost every request. Even in 
Struts, I wouldn't touch the RequestProcessor. Use a ServletFilter. They 
are easy to set up and I'll provide an example if you want one. I'm not 
sure of the implications of using them with JSF, but I'm sure they could 
be used.


--
Rick

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



Re: Validation :: best practice?

2005-09-09 Thread Rick Reumann

emre akbas wrote the following on 9/9/2005 10:12 AM:
 ,
I want to know what the state-of-the-art practices about Struts validation 
are. It is well-known that there are some problems in automatic validation. 
Here is a good article: 
http://www.reumann.net/struts/articles/request_lists.jsp Are the ideas in 
this article obsolete? 


I don't think they are obsolete. I still find it easier to call validate 
manually. (By the way, in that article, I mention a technique that I 
really don't use myself.. I don't even bother calling the form's 
validate method. I actually provide my own validate() method in my 
Action that validates what I want. Both work ok though and since many 
already have a validate method in their ActionForm, I used that as the 
example for the lesson.)


As far as I understand, the best practice is calling the validate() method 
manually. 


If you have session based forms or you do not need to re-display 
non-ActionForm objects back on the page if validation fails, the 
standard validation framework is 'ok', but I still like to do do things 
one consistent way so doing my validation in my actions works for me. I 
will almost bet there will be a time when you'll run into some headaches 
trying to use the validation frameworks as it stands. (Validation in 
struts is not one of Struts' strong points unfortunately. It's one of 
the number one headaches for beginning struts users.)


This requires that we write ... validate="false" ... in the 
action-mapping definition. 


If I remember correctly, if you leave off the validate="false" it 
defaults to false. You just need to set it to true if you want 
validation, but I could be wrong there.. it's been a while:)


However, if we do this, we cannot use javascript 
(client-size) validation. I want to use javascript validation. What are the 
possible solutions? 


I never had too much luck with the client side validation stuff and I 
only use it in *very* limited circumstances, since I like validating on 
the server side.  The javascript validation with the validator seemed 
more of a headache then it was worth when I first started trying it out 
(I'm sure it's improved a lot since then, so it might work nicely for 
you). For client side validation I just write my own and don't rely on 
the validator stuff to handle it. Since I rarely validate on the client 
it's not much of an issue for me.


--
Rick

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



Re: [Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread Gary VanMatre
There are several ways to handle this, maybe too many options:

>From a view controller:

   String userName = getBean("sessionScope.userName");

Or, create a managed bean with the parameter like a Struts form bean:



  userParms
  myobject
  request
  
userName
#{sessionScope.userName}
  


  myobject object = (myobject) getBean("userParam");


Or, if you like the Struts dyna form:

  userParms
  java.util.TreeMap
  request
 
   
java.lang.String
java.lang.String
 
   userName
   #{sessionScope.userName}
 

   




  myparms Map = (Map) getBean("userParam");



Gary





--- Begin Message ---
Hi all:

I am making small and halting progress with my Shale application and have 
this pretty fundamental question. Suppose my backing bean has this code:

public String getWorkList() {

String username = (String) FacesContext.getCurrentInstance()
 .getExternalContext().getSessionMap()
.get(Constants.userKey);
String password = (String) FacesContext.getCurrentInstance()
 .getExternalContext().getSessionMap().get(Constants.pwKey);
if ((username == null) || (password == null))
return "loggedOff";
..etc.

I can see myself doing this check many times in many methods in many 
backing beans (which extend AbstractViewController). What is the 
appropriate way to implement this check - or for that matter any other 
common code? I can of course extend AbstractViewController and write this 
method there and all my beans can call it... but I kind of think there 
must be a better way..? (Something like Struts' RequestProcessor..) I 
thought perhaps this may be where preprocess() can come in handy - 
however, that method returns void. Plus it is within each backing bean and 
not common to all backing beans..

Thanks in advance,
Geeta
--- End Message ---
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Generate ActionMessage object without referring to the resource file

2005-09-09 Thread Wendy Smoak

From: "Deepesh Nandal" <[EMAIL PROTECTED]>

 I need to generate an ActionMessage object without referring to the 
resource file, as the message is received from a different server on the 
fly.


I need it so that the message could be a Java String object ,the Following 
code DOESN'T work :


String message = "I am a message" ;
ActionMessage message = new ActionMessage(message);


A quick look at the Javadoc shows that the constructor that takes a String 
expects that String to be a key.  Try this one instead:


http://struts.apache.org/api/org/apache/struts/action/ActionMessage.html#ActionMessage(java.lang.String,%20boolean)

[untested]
ActionMessage message = new ActionMessage(message,false);

--
Wendy Smoak


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



Re: Validation :: best practice?

2005-09-09 Thread Niall Pemberton
I think you're assertion is incorrect. including the  tag
on a page will generate all the javascript validations for a form - they get
"invoked" by you putting some javascript in the 's onsubmit
event - nothing to do with the validate setting in the struts config. All
the validate=false setting controls is server side validation.

Niall

- Original Message - 
From: "emre akbas" <[EMAIL PROTECTED]>
Sent: Friday, September 09, 2005 3:12 PM

> This requires that we write ... validate="false" ... in the
> action-mapping definition. However, if we do this, we cannot use
javascript
> (client-size) validation. I want to use javascript validation



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



[Shale]Best practice to add common code for all command actions for all backing beans

2005-09-09 Thread gramani
Hi all:

I am making small and halting progress with my Shale application and have 
this pretty fundamental question. Suppose my backing bean has this code:

public String getWorkList() {

String username = (String) FacesContext.getCurrentInstance()
 .getExternalContext().getSessionMap()
.get(Constants.userKey);
String password = (String) FacesContext.getCurrentInstance()
 .getExternalContext().getSessionMap().get(Constants.pwKey);
if ((username == null) || (password == null))
return "loggedOff";
..etc.

I can see myself doing this check many times in many methods in many 
backing beans (which extend AbstractViewController). What is the 
appropriate way to implement this check - or for that matter any other 
common code? I can of course extend AbstractViewController and write this 
method there and all my beans can call it... but I kind of think there 
must be a better way..? (Something like Struts' RequestProcessor..) I 
thought perhaps this may be where preprocess() can come in handy - 
however, that method returns void. Plus it is within each backing bean and 
not common to all backing beans..

Thanks in advance,
Geeta


Validation :: best practice?

2005-09-09 Thread emre akbas
Hi, 
I want to know what the state-of-the-art practices about Struts validation 
are. It is well-known that there are some problems in automatic validation. 
Here is a good article: 
http://www.reumann.net/struts/articles/request_lists.jsp Are the ideas in 
this article obsolete? 
As far as I understand, the best practice is calling the validate() method 
manually. This requires that we write ... validate="false" ... in the 
action-mapping definition. However, if we do this, we cannot use javascript 
(client-size) validation. I want to use javascript validation. What are the 
possible solutions? 
Thank you in advance.


Hibernate 3 versioning/concurrency

2005-09-09 Thread Lee Harrington
Hi folks,

Would love to get some "best practices" for setting up hibernate with 
struts. I'm gettin "staleobject" exceptions when I'm the only one editing. I 
had this problem with Hibernate 2 and eventually solved it, but never really 
understood.

Now the problem is back, and I'm stuck again.

Not sure what to put in the hbm.xml when it comes to version.
Not sure that to put in my action, my tableService class, when to begin the 
transaction, how to end it (applicaiton filter?)

Anybody got the 411 on how to properly set things up?

Lee


Hib

2005-09-09 Thread Lee Harrington



Fwd: Re: Fwd: Re: Re: RE: how to represent nested bean properties in a jsp form

2005-09-09 Thread temp temp

I  solved the problem by creating an instance of
AddressVO in the formbean.

Here  is my code  after modifications.


  public class ServiceSelectionForm extends ActionForm
{

private AddressVO  addressVO  = new  AddressVO();   
public AddressVO getAddressVO() {
return addressVO;
}
public void setAddressVO(AddressVO addressVO) {
this.addressVO = addressVO;
}   
  } 
I am wondering is this the right approach or is there 
a better way to deal with   nestedbean in a  formbean 
or how to create  an instance of   nestedbean in a
formbean.

Note: forwarded message attached.





__
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/--- Begin Message ---
That suggests that one of the classes or getter methods isn't declared 
public (the sample source you posted does that, so that's probably not 
it) or that addressVO is null in the form bean. How do you populate the 
form bean? What happens if you call getAddressVO().getState() on the 
form bean directly?


L.

temp temp wrote:
I get the following error 



[Invalid argument looking up property addressVO.state
of bean serviceSelectionForm]:
javax.servlet.jsp.JspException: Invalid argument
looking up property addressVO.state of bean
serviceSelectionForm
at
org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:1036)



Note: forwarded message attached.
thanks & regards

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 





Subject:
Re: Re: RE: how to represent nested bean properties in a jsp form
From:
Michael Jouravlev <[EMAIL PROTECTED]>
Date:
Thu, 8 Sep 2005 12:05:36 -0700
To:
Struts Users Mailing List 

To:
Struts Users Mailing List 


So, what happens if you use 



Put a debug statement in the setter just in case, is it called?

Michael.

On 9/8/05, temp temp <[EMAIL PROTECTED]> wrote:



here is my struts config










Note: forwarded message attached.
thanks & regards





__
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/


-- Forwarded message --
From: Michael Jouravlev <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Date: Thu, 8 Sep 2005 11:50:06 -0700
Subject: Re: RE: how to represent nested bean properties in a jsp form
What, it does not work? How about setting form name explicitly:



You have defined the formbean in the struts config, have you?

Michael.

On 9/8/05, temp temp <[EMAIL PROTECTED]> wrote:


 This is my jsp
 
  
  
 

  I want  input textfield  from  jsp to represent porperty  state  of
AddressVO.

  I mean when the form is submitted  I want property state from AddressVO
to get populated with the value of the textfiled.How can I acheive this.


-
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]


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

Re: Eclipse 3.1 and struts 1.2.7

2005-09-09 Thread Ed Griebel
I've used myeclipse for 6-9 months and I've really come to like the
JSP and XML editors. I've found the Struts editing to be useless
unless your project is set up exactly the way the plugin expects it to
be.

I just started using NitroX, it is way better integrated with Struts
and JSPs than myeclipse, and the struts-specific editors will adapt to
your directory structure. I don't think I'll go back to myeclipse, but
NitroX is more expensive too.

-ed

On 9/9/05, Rafael Nami <[EMAIL PROTECTED]> wrote:
> I think wtp is a very good choice, but it doesn't run "for" Struts. If
> you want something that can simplify your development with Struts, I
> think is better thinking on the purchase of MyEclipse(awesome plugin,
> not too expensive), or if you want a free option, take a look at the
> new NetBeans(5.0). It has Struts and JSF capabilities.
> 
> Hope that it could help
> 
> Rafael Mauricio Nami
> 
> 2005/9/9, R Rajendran <[EMAIL PROTECTED]>:
> > Go through the Wrox publication Book - "Professional Jakarta Struts"
> >
> > 
> >
> > From: M. Imran [mailto:[EMAIL PROTECTED]
> > Sent: Thu 9/8/2005 4:58 AM
> > To: Struts Users Mailing List
> > Subject: Re: Eclipse 3.1 and struts 1.2.7
> >
> >
> >
> > I was wondering if I can use Struts with Eclipse (3.1) or some free plugins.
> > MyEclipse is a good option but its not free.
> >
> > Regards,
> > Imran
> > - Original Message -
> > From: "Ayusman dikshit" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" 
> > Sent: Thursday, September 08, 2005 12:59 AM
> > Subject: RE: Eclipse 3.1 and struts 1.2.7
> >
> >
> > >
> > > Hi Imran,
> > > Try to download latest MyEclipse (just google it and u will find it) and
> > > download this pdf
> > > http://www.eclipsekickstart.com/chapters/EclipseKickStart-ch11.pdf  this
> > > will guide you thru. , hope this helps.
> > >
> > > Regards
> > > Ayusman
> > >
> > > -Original Message-
> > > From: M. Imran [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, September 08, 2005 12:12 PM
> > > To: user@struts.apache.org
> > > Subject: Eclipse 3.1 and struts 1.2.7
> > >
> > > Dear all,
> > > I am trying to build my first application with Tomcat, Eclipse 3.1 &
> > > Struts 1.2.7, can anyone tell me how to configure them? Any help link or
> > > example will be much appreciated?
> > >
> > > Thanks you,
> > > Imran
> > >
> > >  CAUTION - Disclaimer *
> > > This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> > solely for the use of the addressee(s). If you are not the intended
> > recipient, please notify the sender by e-mail and delete the original
> > message. Further, you are not to copy, disclose, or distribute this e-mail
> > or its contents to any other person and any such actions are unlawful. This
> > e-mail may contain viruses. Infosys has taken every reasonable precaution to
> > minimize this risk, but is not liable for any damage you may sustain as a
> > result of any virus in this e-mail. You should carry out your own virus
> > checks before opening the e-mail or attachment. Infosys reserves the right
> > to monitor and review the content of all messages sent to or from this
> > e-mail address. Messages sent to or from this e-mail address may be stored
> > on the Infosys e-mail system.
> > > ***INFOSYS End of Disclaimer INFOSYS***
> > >
> > > -
> > > 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]
> >
> >
> 
> 
> --
> Java - Assim no Server como no Palm
> Java - thus in the Server as it is in Palm
> 
> -
> 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: JSF -> Shale transition

2005-09-09 Thread Walton, Kaleb \(ISS Southfield\)
What do you mean by "inferior if you are interested in performance". Is
the overhead of the dialog/navigation processing pretty high? 

-Original Message-
From: Dakota Jack [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 08, 2005 4:19 PM
To: Struts Users Mailing List
Subject: Re: JSF -> Shale transition

Well, have you considered classic struts?  Shale is really meant for
people who are trying to change an application from JSF to Struts, and
not everyone, including myself, think this is a good idea.  Shale is not
Struts improved but a transition to something entirely different, and
inferior in my opinion, if you are interested in performance.

On 9/8/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:
> We're wanting to go from our home-brewed method of interaction using 
> jsps and servlets that are not very consistent in their expression 
> (other than the general jsp/servlet specs) to something that defines 
> interactions more concretely. Our current frustrations include form 
> handling, page transitions, forwarding, etc.
> 
> Regards,
> Kaleb
> 
> -Original Message-
> From: Dakota Jack [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 08, 2005 12:44 AM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: Re: JSF -> Shale transition
> 
> Moving from Struts to JSF is moving to a "more defined" framework?
> That is pretty difficult to grasp.  Could you explain?
> 
> 
> 
> On 9/6/05, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> > On 9/6/05, Walton, Kaleb (ISS Southfield) <[EMAIL PROTECTED]> wrote:
> > >
> > > Hey all,
> > >
> > > As I had mentioned in a previous post, our team is looking to move

> > > towards a more well defined web framework. From my limited 
> > > experience using Shale (ran the shale-use-cases) I'm not feeling 
> > > very confident that we could use it *right away*.
> > >
> > > I wanted to ask for opinions on what would be a gradual step for 
> > > us to take towards the Shale framework (once it's stable enough to

> > > use in a production environment). For example, would JSF + Spring 
> > > be a good combo that would make for an easy transition to Shale? 
> > > Struts +
> 
> > > WebFlow + Spring? Etc..
> > >
> > > Do the aforementioned framework combinations even matter? Will 
> > > Shale
> 
> > > just add another layer on top or glue together with what we would 
> > > have already developed? Although I've been reading up on Shale 
> > > quite
> 
> > > a bit, my understanding is still limited so please excuse me if 
> > > these questions are easily found through already documented
sources.
> 
> > > If they are, please share where they can be found :)
> >
> >
> >
> > The key to choosing a transition approach is what you want to use 
> > for the "front controller" part of your architecture durng the 
> > interim. If
> 
> > you're starting from Struts, a straightforward path would be to use 
> > the integration library to start switching your pages to using JSF 
> > components instead of Struts HTML tags (without having to modify 
> > your actions), followed by a migration of the back-end logic to 
> > using JSF's
> 
> > front controller and request processing lifecycle.
> >
> > If, on the other hand, you decide to commit to JSF's controller 
> > early rather than late, you might as well just use Shale along with 
> > it from the beginning. Unlike the way that other frameworks deal 
> > with JSF, Shale
> > *assumes* you will be using the JSF controller architecture, and it 
> > just adds ease of use around problems you'll face anyway. It doesn't

> > try to treat JSF as purely a component architecture.
> >
> > Craig McClanahan
> >
> > Regards,
> > > Kaleb
> > >
> > > --
> > > --
> > > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> 
> 
> --
> "You can lead a horse to water but you cannot make it float on its 
> back."
> ~Dakota Jack~
> 
> -
> 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]
> 
> 


--
"You can lead a horse to water but you cannot make it float on its
back."
~Dakota Jack~

-
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: Cookie problem is killing me

2005-09-09 Thread Martin Gainty

Good Morning David
The domain name you supply must conform to rfc2109 domain name specification 
(reference)

http://www.faqs.org/rfcs/rfc2109.html
to quote
"7.2  Protocol Design

  The restrictions on the value of the Domain attribute, and the rules
  concerning unverifiable transactions, are meant to reduce the ways
  that cookies can "leak" to the "wrong" site.  The intent is to
  restrict cookies to one, or a closely related set of hosts.
  Therefore a request-host is limited as to what values it can set for
  Domain.  We consider it acceptable for hosts host1.foo.com and
  host2.foo.com to share cookies, but not a.com and b.com.
"
when in doubt your domain name should specify wither the FQDN
or the IP
HTH,
Martin-

- Original Message - 
From: "David Thielen" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, September 08, 2005 11:46 PM
Subject: Cookie problem is killing me



Hi;



No this isn't a struts problem - but this is driving me up the wall and
there are a lot of smart people here.



This is all on my system - Windows XP / IIS 5.1. So I am hitting localhost
from IE to tomcat.



When I add a cookie to the HttpServletResponse, if I leave the cookie 
domain

unset (ie null), then it creates a cookie using the name of the servlet.



If I set the domain - I have tried "localhost", ".localhost", "belle", and
".belle" (my computer's name is belle), then no cookie is saved.



Any idea why?



Thanks - dave





David Thielen

303-499-2544

www.windwardreports.com 






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



Re: Action based validations

2005-09-09 Thread Joe Germuska

At 2:55 PM -0400 9/8/05, rajiv verma wrote:

I am using struts 1.2 and my client side validations using based on action
rather than form are not working? Is there a bug in the 1.2 release. I have
worked previously with 1.1 and it used to work just fine.
In the validation file,
instead of



I could use




If you have simply upgraded versions of Struts, this should not have 
broken; however, you may have run into one of the most unfortunate 
naming mistakes in Struts (probably worse than ActionErrors and 
ActionMessages!)


Struts provides several varieties of validation ActionForm classes 
which integrate with the commons-validator framework.  The only 
difference between these varieties is the key which they use to 
lookup validation rules.   Some use the name of the form bean, others 
use the action path


This wiki page attempts to explain some of the differences: 
http://wiki.apache.org/struts/ValidatorActionForms


Also, Niall's change of April, 2004 now enables other users to easily 
subclass Validator Form to use any variety of strategies to determine 
the validator rules key. 
(http://issues.apache.org/bugzilla/show_bug.cgi?id=28150)


Hope this helps.

Joe

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex


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



Re: Eclipse 3.1 and struts 1.2.7

2005-09-09 Thread Rafael Nami
I think wtp is a very good choice, but it doesn't run "for" Struts. If
you want something that can simplify your development with Struts, I
think is better thinking on the purchase of MyEclipse(awesome plugin,
not too expensive), or if you want a free option, take a look at the
new NetBeans(5.0). It has Struts and JSF capabilities.

Hope that it could help

Rafael Mauricio Nami

2005/9/9, R Rajendran <[EMAIL PROTECTED]>:
> Go through the Wrox publication Book - "Professional Jakarta Struts"
> 
> 
> 
> From: M. Imran [mailto:[EMAIL PROTECTED]
> Sent: Thu 9/8/2005 4:58 AM
> To: Struts Users Mailing List
> Subject: Re: Eclipse 3.1 and struts 1.2.7
> 
> 
> 
> I was wondering if I can use Struts with Eclipse (3.1) or some free plugins.
> MyEclipse is a good option but its not free.
> 
> Regards,
> Imran
> - Original Message -
> From: "Ayusman dikshit" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Sent: Thursday, September 08, 2005 12:59 AM
> Subject: RE: Eclipse 3.1 and struts 1.2.7
> 
> 
> >
> > Hi Imran,
> > Try to download latest MyEclipse (just google it and u will find it) and
> > download this pdf
> > http://www.eclipsekickstart.com/chapters/EclipseKickStart-ch11.pdf  this
> > will guide you thru. , hope this helps.
> >
> > Regards
> > Ayusman
> >
> > -Original Message-
> > From: M. Imran [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, September 08, 2005 12:12 PM
> > To: user@struts.apache.org
> > Subject: Eclipse 3.1 and struts 1.2.7
> >
> > Dear all,
> > I am trying to build my first application with Tomcat, Eclipse 3.1 &
> > Struts 1.2.7, can anyone tell me how to configure them? Any help link or
> > example will be much appreciated?
> >
> > Thanks you,
> > Imran
> >
> >  CAUTION - Disclaimer *
> > This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely for the use of the addressee(s). If you are not the intended
> recipient, please notify the sender by e-mail and delete the original
> message. Further, you are not to copy, disclose, or distribute this e-mail
> or its contents to any other person and any such actions are unlawful. This
> e-mail may contain viruses. Infosys has taken every reasonable precaution to
> minimize this risk, but is not liable for any damage you may sustain as a
> result of any virus in this e-mail. You should carry out your own virus
> checks before opening the e-mail or attachment. Infosys reserves the right
> to monitor and review the content of all messages sent to or from this
> e-mail address. Messages sent to or from this e-mail address may be stored
> on the Infosys e-mail system.
> > ***INFOSYS End of Disclaimer INFOSYS***
> >
> > -
> > 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]
> 
> 


-- 
Java - Assim no Server como no Palm
Java - thus in the Server as it is in Palm

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



ActionForm Problem

2005-09-09 Thread OJAY78
[EMAIL PROTECTED]

I have a problem with my Form Bean:

On my jsp I have have a List of values and put them on my jsp with this code






<%=lineNo.intValue()+1%>











I get those values I want on my JSP. I tried to get those values into my
ActionForm with indexed properties but it wont work, I dont now whyhere
is my code from my action form, I have a few log.debug() in it so that I can
see if it works but none of my log.debug() shows up.

public class SaveFVKNForm extends ActionForm {

private Logger log = Logger.getLogger(LoginAction.class);

private List fvknListIndexed;


/** 
 * Method validate
 * @param mapping
 * @param request
 * @return ActionErrors
 */
public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request) {

return new ActionErrors();
}

/** 
 * Method reset
 * @param mapping
 * @param request
 */
public void reset(ActionMapping mapping, HttpServletRequest request) {
   log.debug("FORM RESET");
fvknListIndexed = new ArrayList();
}

/**
 * @return Returns the formFieldIndexed.
 */
public FormValueKeyName getFvknList(int idx) {
log.debug("FORM getFVKN");
if( fvknListIndexed == null ) 
fvknListIndexed = new ArrayList();

resizeList(idx);

if( fvknListIndexed.size() > idx )
return (FormValueKeyName) fvknListIndexed.get(idx);
else 
return new FormValueKeyName();
}
/**
 * @param formFieldIndexed The formFieldIndexed to set.
 */
public void setFvknList(int idx, FormValueKeyName field) {
log.debug("FORM set FVKNFIELD");
if( fvknListIndexed == null ) 
fvknListIndexed = new ArrayList();

resizeList(idx);

if( fvknListIndexed.size() > idx )
this.fvknListIndexed.set(idx, field);
else
throw new RuntimeException("Index out of bounds!");
}

/**
 * @param fieldList
 */
public void setFvknList(List fieldList) {
log.debug("FORM SET FIELDLIEST");
this.fvknListIndexed = fieldList;
}
/**
 * @param fieldList
 */
public List getFieldList() {
log.debug("FORM getFieldlist");
if( fvknListIndexed == null ) 
fvknListIndexed = new ArrayList();

return this.fvknListIndexed;
}


In my Action I want to get those values into my logfile but the List is
empty

here is my action

SaveFVKNForm saveFVKNForm =  new SaveFVKNForm();
Integer size = new Integer(saveFVKNForm.getFieldList().size());

log.info(size.toString());

for (int i=0; ihttp://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++

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



Re: Action based validations

2005-09-09 Thread Adam Hardy

rajiv verma on 08/09/05 19:55, wrote:
I am using struts 1.2 and my client side validations using based on action 
rather than form are not working? Is there a bug in the 1.2 release. I have 
worked previously with 1.1 and it used to work just fine.

In the validation file,
instead of 
 



I could use



Any clues??



Rajiv,
shooting from the hip, I'd recommend you check that you have the latest 
version of commons-validator, or rather the correct version of validator 
for what you want to do.


Have you read up on the latest validator functionality? I suspect that 
it may have changed and that this behaviour with actions has been 
superceded. But that's a wild wild guess, it's been over a year since I 
worked with it myself.



Adam

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



Re: Template Depository, but how?

2005-09-09 Thread David Haynes
I'm not sure of your detailed requirements, but you may find a tool such 
as xmoon (http://xmoon.sourceforge.net) or velocity 
(http://jakarta.apache.org/velocity/) useful.


-david-

Danny Lee wrote:


Hi guys,

Let's imagine that I'm building a web store and have a lot of 
different product groups.


For every product group I have a template describing how to peresent 
the products in this group.


My web store have to be cool, so there is an admin interface, where 
the admin can create new product groups. So he can also define custom 
templates for presentation of these groups.


The question is how to put custom DB-stored templates with some data?
The only way I could think in the moment is creating some crazy bean,
which mixes the stuff together and generates some output, but I have a 
feeling this may be quite difficult and also quite slow solution, as 
long this mechanism have to be started for each product/product list 
presentation.


Well, I supose I'm not the first poor guy having this problem, so any 
tips and suggestions are welcome :)


cheers

Danny




-
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]



Template Depository, but how?

2005-09-09 Thread Danny Lee

Hi guys,

Let's imagine that I'm building a web store and have a lot of different 
product groups.


For every product group I have a template describing how to peresent the 
products in this group.


My web store have to be cool, so there is an admin interface, where the 
admin can create new product groups. So he can also define custom 
templates for presentation of these groups.


The question is how to put custom DB-stored templates with some data?
The only way I could think in the moment is creating some crazy bean,
which mixes the stuff together and generates some output, but I have a 
feeling this may be quite difficult and also quite slow solution, as 
long this mechanism have to be started for each product/product list 
presentation.


Well, I supose I'm not the first poor guy having this problem, so any 
tips and suggestions are welcome :)


cheers

Danny




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



Generate ActionMessage object without referring to the resource file

2005-09-09 Thread Deepesh Nandal
Hi There,
  I need to generate an ActionMessage object without referring to the resource 
file, as the message is received from a different server on the fly.
 Following code works fine if i have "Login.invalid" defined in the resource 
property file.

ActionMessage message = new ActionMessage("Login.invalid");


But I need it so that the message could be a Java String object ,the Following 
code DOESN'T work :

String message = "I am a message" ;
ActionMessage message = new ActionMessage(message);

Please Help,

Many Thanks,
Deepesh.




RE: Chain of commands in 1.3

2005-09-09 Thread Marco Mistroni
Hello Michael,
Not sure if this is of any help, but
Mr Ted Husted has written a MailReader application
That uses Struts and Common Chains, 
When I checked it out (last april) it was at this link

http://svn.apache.org/viewcvs.cgi/struts/sandbox/trunk/?root=Apache-SVN

I have followed that app in writing my own that uses commands defined
In a spring config file..

Business logic is done in the command, Actions behave exactly like
Before..

I'll try to answer some of your question (anyone pls correct me if I am
Wrong...) ... based on what I have done using samples & articles around,
& advices from Joe et other 1.3 guys..
Keep in mind that what I am referring is to an application like MailReader,
I have used Commands just for moving logic out of Actions,not for modifying
The chain used by struts itself..


> (1) The first one is where to check 1.3 out from? Ok, I might have not
>been following the list, but http://struts.apache.org does not have
>links to 1.3 source code nor it explains how to set up Subversion. I
>

Last time I checked (April) jars were at this link
http://svn.apache.org/builds/struts/maven/nightly/


beware though that Struts 1.3 does not include by default taglibs & tiles,
so you need to download a separate jar for that

>Also, I would like to get all sources in a jar file with a build
>script. I do not really want to check out file by file from repository
>unless this is really justified.

At same location there should be a zip file for sources (which includes
Also build.xml)


>(2) How tight is integration between commands from chain-config.xml
>and actions from struts-config.xml ? Should not it be possible to
>define actions in chain-config.xml as commands? I know that actions
>have more attributes and they have  elements, but tighter
>integration would be a great thing.

This answer is from my point of view Following Ted's example,
All my business logic is now in the Command.. all action does Is simply
To build context and pass it to the command.. so code in action is really
very simple..


>Command returns true or false, Action returns ActionForward. How does
>this work? Where the action forward is returned to? Is it set into the
>context?

ActionForward will be selected depending on what the command return.
Normally if the command return false, you will go to original page..


>(4) Neither Bill's article nor Vic's example stress out the scope of
>the Context. Is it filled out for each request? 

Yes in my opinion..

>Can I set up the scope
>for the Context? Considering that Context has accessors for request,
>session and servletcontext, it should be a long-term object. Whom it
>belongs to? Should access to it be synchronized?

If I am right, context is the only way to pass data from Action to Commands.
Again, following ted's example, my Action build a context and populates with
What the Command needs to do its logic. So, for example, get that username &
password from request, put it into the Context and pass the Context to the
command, which will use what is in the context to do a login operation for
example

>(5) It is nice that process() is changed into a chain, but what are
>the relations and dependencies between the commands? How do they
>affect each other? 

They will affect each other when a command is itself a chain of commands..
Sorry I don't know how to explain it better, maybe joe or other 1.3
committers could make a case (I didn't find one for my needs)..


>What do they store in the context and what do they
>expect?

What do they store: the data resulted from the operation the command
executed, which could be needed by an Action or other commands

What do they expect: the data needed for performing the operation
That the command does.. for example logging in, querying a database,
inserting data etc..

> What would be the effect of removing a standard command or
>adding a new one? This question does not require immediate answer,
>rather a reminder for better docs ;-)

Are you talking about the chain used by Struts itself? Well If you
Remove a command out of the struts chain, I think things are going
To be pretty difficult :)
Adding/overriding commands will result in your commands being executed, and
as long as the existing commands can find in the context what they need,
There shouldn't be any problems..

If you check StrutsWS_Struts1.3 app at this link

http://cvs.sourceforge.net/viewcvs.py/strutsws/

it overrides struts default chain to add additional processing..


hope I haven't confused you more :)

HTH
marco









(6) Bill's article [2] shows a login interceptor implemented as
command, but all it does is displays 403 error. Well, it reminds that
request and response objects did not go nowhere, and can be used, but
what I would like to see is not short-circuiting the chain, but
redirecting to a login action. I am not sure how this is going to work
in the chain. Should I somehow preselect the interceptor action (login
action) before SelectAct

AW: A nice easy question

2005-09-09 Thread Martin Kindler
I would use an int (whether cents or tenth of cent if you are in the oil
business depends on your application). No rounding problems, no parsing
problems.

Martin

> -Ursprüngliche Nachricht-
> Von: Murray Collingwood [mailto:[EMAIL PROTECTED] 
> Gesendet: Freitag, 9. September 2005 09:15
> An: user@struts.apache.org
> Betreff: A nice easy question
> 
> 
> Hi all
> 
> I put a price field (float) in a form (textbox) but had some 
> trouble parsing the text using 
> the DemicalFormat class (it doesn't seem to like the 'float' 
> type).  So I went through 
> changing my field to 'int' but now of course I can only store 
> whole dollar amounts.
> 
> To save me lots of time, should I:
> 
> a) use long
> b) use double
> c) go back to float and fix my parsing
> d) use int and store the value as cents (rather than dollars) 
> (n*100 and n/100)
> 
> Kind regards
> mc
> 
> 
> FOCUS Computing
> Mob: 0415 24 26 24
> [EMAIL PROTECTED]
> http://www.focus-computing.com.au
> 
> 
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.10.19/93 - Release 
> Date: 8/09/2005
> 
> 
> -
> 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]



Antwort: A nice easy question [ Virenprüfung durchgeführt]

2005-09-09 Thread oliver . graf





"Murray Collingwood" <[EMAIL PROTECTED]> am 09.09.2005 09:14:58

Bitte antworten an "Struts Users Mailing List" 

An: user@struts.apache.org
Kopie:
Thema:  A nice easy question [Virenprüfung durchgeführt]




b) use double

If you have to do calculations with the value, it's better to use double
since it is much more precise.



regards
   Olli











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



RE: A nice easy question

2005-09-09 Thread Murray Collingwood
Thanks Kathir

So which class do you use to format the float into a String representation like 
"$#,##0.00" ?

Kind regards
mc

On 9 Sep 2005 at 12:50, Murugesan, Kathiresan (Cognizant) wrote:

> Its always better to use Float object while handling price related fields...
>  
> Regards
> Kathir.
> 
> 
> 
> From: Murray Collingwood [mailto:[EMAIL PROTECTED]
> Sent: Fri 9/9/2005 12:44 PM
> To: user@struts.apache.org
> Subject: A nice easy question
> 
> 
> 
> Hi all
> 
> I put a price field (float) in a form (textbox) but had some trouble parsing 
> the text 
using
> the DemicalFormat class (it doesn't seem to like the 'float' type).  So I 
> went through
> changing my field to 'int' but now of course I can only store whole dollar 
> amounts.
> 
> To save me lots of time, should I:
> 
> a) use long
> b) use double
> c) go back to float and fix my parsing
> d) use int and store the value as cents (rather than dollars) (n*100 and 
> n/100)
> 
> Kind regards
> mc
> 
> 
> FOCUS Computing
> Mob: 0415 24 26 24
> [EMAIL PROTECTED]
> http://www.focus-computing.com.au
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.10.19/93 - Release Date: 8/09/2005
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.19/93 - Release Date: 8/09/2005


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



RE: A nice easy question

2005-09-09 Thread Murugesan, Kathiresan \(Cognizant\)
--- Begin Message ---
Its always better to use Float object while handling price related fields...
 
Regards
Kathir.



From: Murray Collingwood [mailto:[EMAIL PROTECTED]
Sent: Fri 9/9/2005 12:44 PM
To: user@struts.apache.org
Subject: A nice easy question



Hi all

I put a price field (float) in a form (textbox) but had some trouble parsing 
the text using
the DemicalFormat class (it doesn't seem to like the 'float' type).  So I went 
through
changing my field to 'int' but now of course I can only store whole dollar 
amounts.

To save me lots of time, should I:

a) use long
b) use double
c) go back to float and fix my parsing
d) use int and store the value as cents (rather than dollars) (n*100 and n/100)

Kind regards
mc


FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.19/93 - Release Date: 8/09/2005


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



<>--- End Message ---
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply 
e-mail and destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing 
or copying of this email or any action taken in reliance on this e-mail is 
strictly 
prohibited and may be unlawful.

  Visit us at http://www.cognizant.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

A nice easy question

2005-09-09 Thread Murray Collingwood
Hi all

I put a price field (float) in a form (textbox) but had some trouble parsing 
the text using 
the DemicalFormat class (it doesn't seem to like the 'float' type).  So I went 
through 
changing my field to 'int' but now of course I can only store whole dollar 
amounts.

To save me lots of time, should I:

a) use long
b) use double
c) go back to float and fix my parsing
d) use int and store the value as cents (rather than dollars) (n*100 and n/100)

Kind regards
mc


FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.19/93 - Release Date: 8/09/2005


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



Re: Struts forward and jsessionid

2005-09-09 Thread Craig McClanahan
On 9/8/05, Néstor Boscán <[EMAIL PROTECTED]> wrote:
> 
> Hi Michael
> 
> In my case, I'm working with WAP applications that require the jsessionid 
> to
> be in the URL. In the case of Struts redirect forward it doesn't put the
> jsessionid in the URL. When I browse using a WAP my session is lost in the
> process.


Struts is just using the servlet container facilities, which (by default) 
will use a session id cookie if the client (being directly corresponded 
with) supports that. You'll need to investigate the configuration properties 
on your container to turn off using cookies for session management -- if you 
do that, all the Struts session management will be done with URL rewriting.


Regards,
> 
> Néstor Boscán



Craig