Problem with Dyna Form

2005-07-27 Thread Kade Jeevan Kumar
Hi All,
 
My requirement is to generate a set of dynamic rows(with checkbox and combo 
box) at client side using JSP and Struts 1.1.
As of now, i am generating the above stuff using java script.
How can i use Dyna Form to meet the above requirement (or) suggest me other way 
if u have any solution for this.

-Thanks in Advance
Jeevan

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

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Tamas Szabo

Hi Frank,

Doesn't the sessionCount get decremented regardless of whether the 
session is being destroyed as the result of a regular logoff or 
timeout as well as if it was a rejected logon (i.e., max sessions 
already in use)?  I dealt with this problem in the code I'm adding to 
Java Web Parts tomorrow, but maybe you found a better way than I did :)  


Yes, the sessionCount is decremented everytime a session is destroyed 
regardless of regular logoff, 'forced' logoff (max sessions in use) :-)) 
or timeout.

But that's what I wanted. Do you see a problem with it?
sessionCount is the number of existing sessions, so I decrement the 
sessionCount everytime a session is destroyed(no matter why it was 
destroyed).


Also, I was a bit surprised to learn that filters fire BEFORE 
listeners... it seemed more logical the other way around, but it's not 
reality.  Any problem with what you've done with that in mind?


A SessionContextListener's sessionCreated method will execute when a new 
HttpSession is created.

HttpSessions are created by some servlet or jsp code.
So if you use a Filter that catches any request, the Filter will fire 
before any code that could create a session has a chance to execute.


If the request is not for the 'special' appInUse.jsp or logout.jsp(by 
the way I think that it's ok if we only treat appInUse.jsp specially, 
logout.jsp can be
treated like all other resources) then I always get a session in the 
usual way:


HttpSession session = request.getSession();

As you know this will create a session if one doesn't exist or it will 
get an existing session.
Because this is a Filter that catches everything, all the sessions will 
be created at this point.


This is also the point where the sessionCreated will be executed if the 
session.isNew().
In the sessionCreated a session is always created, but if maxSessions 
was exceeded then we

flag the session.

Back to the filter code, if the session is flagged then we invalidate it 
and we redirect.


It is always benefic to try to write down in words what your code does.
I think I found a a little problem in my solution :-) :

Ex.:
MAX_SESSIONS = 1
and there is one active session (User A)

User B tries to connect, filter fires, flagged session is created 
sessionCount is 2 now.

We are back in the filter before session.invalidate().

In another thread User A's session is destroyed and the 
sessionDestroyed() is executed which decremenets sessionCount. 
sessionCount = 1


User C comes in, in another thread the filter fires for his request, but 
he will get a flagged session too, 'cause sessionCount is still 1.


However this is a minor issue and it probably can be easily changed by 
not incrementing/decrementing sessionCount in 
sessionCreated()/sessionDestroyed()

if the session is flagged.
This is what you suggested in the first place? :-)

Tamas





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



mutli-checkbox

2005-07-27 Thread Sagar Naik
I would like to create a page which gives shows User
Permissions for some website in form of Checkboxes

String Array listOfPerms => Permissions which are to
be checked 
String Array listOfAllPerms => All the Permissions

I get a null pointer Exception : null Attribute name
I m not able to figure out wht is wrong

Pl lemme knw , what is wrong


Thanks



Fllowing is the jsp page


<%
String strContactId =
request.getParameter("contactId");
UserWP objUserWp = (UserWP)
session.getAttribute(StringConstants.strUserObject);
String [] listOfPerms =
DisplayLists.getPermissionForUser(Integer.parseInt
(strContactId));
String []listOfAllPerms = DisplayLists.getAllUserPerms
();

pageContext.setAttribute("listOfPerms", listOfPerms);
pageContext.setAttribute("listOfAllPerms",
listOfAllPerms);


%>































__
How much free photo storage do you get? Store your friends 'n family snaps for 
FREE with Yahoo! Photos http://in.photos.yahoo.com

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



Path like urls with objects' OIDs: /objects/object/17/198/4 possible?

2005-07-27 Thread Tomasz Nazar


Hi!

I like the idea (pattern) of having actions named in a path/menu-like
way.

Say: /context/employees/emplyee?id=17

But: I'd like to have something more prettier:

Say: /context/emplyee/17

Or even more: /context/archive/1998/employee/tomasz/tasks/7


Can you point me where to look for this? Is there any standard
option for that; some URL pattern rewriting or God knows what.

Do I have to write my own implementation of some method/class and
then parse the url, set proper parameters and pass over to Struts
(dispatcher?) ?

Thanks in advance - Tomasz


-- 
  _i__'simplicity_is_the_key'__tomasz_nazar
  _ii'i_am_concern_oriented'__iiuwr
  _iii__'patsystem.sf.net'___linux_user
  _Heaven_&_Fellows,_PPP__prevayler

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



Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Frank W. Zammetti

Tamas,

Doesn't the sessionCount get decremented regardless of whether the 
session is being destroyed as the result of a regular logoff or timeout 
as well as if it was a rejected logon (i.e., max sessions already in 
use)?  I dealt with this problem in the code I'm adding to Java Web 
Parts tomorrow, but maybe you found a better way than I did :)  Also, I 
was a bit surprised to learn that filters fire BEFORE listeners... it 
seemed more logical the other way around, but it's not reality.  Any 
problem with what you've done with that in mind?


Frank

Tamas Szabo wrote:

One more thing I forgot in my earlier mail.

I used <[EMAIL PROTECTED] session="false" %> in appInUse.jsp

Tamas



-
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: probably a cleaner way... testing for just one user

2005-07-27 Thread Tamas Szabo

One more thing I forgot in my earlier mail.

I used <[EMAIL PROTECTED] session="false" %> in appInUse.jsp

Tamas



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



Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Tamas Szabo

Hi Rick,

Rick Reumann wrote:


David G. Friedman wrote the following on 7/27/2005 12:35 AM:

When a session is created, have the SessionListener update a session 
count.
If the count is 2 or more then call 
SessionEvent.getSession().invalidate()
to cancel the session.  Then the session listener's Session destroy 
method

can decrement the counter appropriately.   And once the main session is
removed (via logout or timeout) it would set the session count back 
to zero

so someone new could login to the webapp.  But it sounds like Rick found
some issues with that kind of approach where it doesn't match that 
simple

kind of logic.



I tried something like the above but there was a problem. The problem 
was that the Session destroy method that decrements the counter gets 
called whenever session.invalidate() is called, so say the first 
person logs in... the static counter goes to "1." Now another person 
tries to login and the session listener sees that it's "1" so it calls 
invalidate. Now you just set it back to 0 so another follow up session 
will think it's ok to login when it isn't.



You can try something like this:

public class SessionListener implements HttpSessionListener {

   public static int sessionCount = 0;
   public static final int MAX_SESSIONS = 2;
  
   public void sessionCreated(HttpSessionEvent sevent) {

   synchronized (SessionListener.class) {
   if (++sessionCount > MAX_SESSIONS) {
   sevent.getSession().setAttribute(Constants.INVALIDATE, 
Boolean.TRUE);

   }
   }
   }

   public void sessionDestroyed(HttpSessionEvent sevent) {
   synchronized (SessionListener.class) {
   --sessionCount;
   }
   }
  
}


In your filter :

...
   if (! (path.contains("appInUse.jsp") || 
path.contains("logout.jsp")) ) {


   HttpSession session = request.getSession();

   if (session.getAttribute(Constants.INVALIDATE) != null) {
   session.invalidate();
   response.sendRedirect(request.getContextPath() + 
"/appInUse.jsp");

   return;
   }
   }
...

I tried a few basic tests and it seems to work.


Regards,
Tamas




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



Re: submitting an array of objects with 1 submit?

2005-07-27 Thread Mick Knutson
> I have a consumer Object that has an array of cards i.e.:
>
> consumer.java
> 
> name
> address
> Card[]
>
> Card
> --
> cardNumber
> status
>
> Now, this is being displayed in the consumer screen, and this displays
> all the cards the consumer has. Also the card.status needs to be updated
> the same time the consumer is updated.
> How would I be able to have this 1 page update the consumer and the
> consumers cards?
>
> --
>
> Thanks
> Mick Knutson
> (925) 951-4126
> HP Consulting Services
> Safeway (Blackhawk Fastword Project)
> J2EE Architect
> ---

--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



"MMS " made the following annotations.
--
Warning: 
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient.  This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s).  If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited.  If you have received this 
message in error, please notify the sender immediately. 
  
==


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



Re: [OT] Create/Edit Form

2005-07-27 Thread Andrew Tomaka
I agree fully, but, unfortunately, I can't do a whole lot about it. 
The databases were set up before I started on the project and I guess
the DBA was pretty hard nosed about changing from how he wanted it. 
Oh well.

~ Andrew Tomaka



On 7/27/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> On 7/27/05, Andrew Tomaka <[EMAIL PROTECTED]> wrote:
> > I realized the
> > problem was actually a bit more complex than I was making it.  The
> > database table I am editing requires two primary keys to make an entry
> > unique (I'm a firm believer in a single PRImary key, but it wasn't my
> > choice).
> 
> Are you are talking about a composite PK?
> 
> > One of the two keys can be changed by this form, so it
> > causes problems.
> 
> It is usually a bad idea to use domain data as PK. Having modifiable
> PKs is [generally] one of the worst ideas.
> 
> 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: probably a cleaner way... testing for just one user

2005-07-27 Thread Frank W. Zammetti
I solved this problem using a combination of a filter and a 
SessionListener... I forgot it at work unfortunately, but it will be 
added to Java Web Parts tomorrow.  It allows you to limit the number of 
sessions to any specific number, and deals with the issue you mention 
with regard to the different between a session not allowed to be created 
and a session being destroyed.


I actually intended to post the code, but like I said, forgot it at work :)

Frank

Rick Reumann wrote:

David G. Friedman wrote the following on 7/27/2005 12:35 AM:

When a session is created, have the SessionListener update a session 
count.
If the count is 2 or more then call 
SessionEvent.getSession().invalidate()
to cancel the session.  Then the session listener's Session destroy 
method

can decrement the counter appropriately.   And once the main session is
removed (via logout or timeout) it would set the session count back to 
zero

so someone new could login to the webapp.  But it sounds like Rick found
some issues with that kind of approach where it doesn't match that simple
kind of logic.



I tried something like the above but there was a problem. The problem 
was that the Session destroy method that decrements the counter gets 
called whenever session.invalidate() is called, so say the first person 
logs in... the static counter goes to "1." Now another person tries to 
login and the session listener sees that it's "1" so it calls 
invalidate. Now you just set it back to 0 so another follow up session 
will think it's ok to login when it isn't.


I used your suggestion though David and did something similar but in a 
HttpSessionBindingListener (code will be shown below).


It still does also require a SessionListener and in 
sessionCreated(HttpSessionEvent event)


event.getSession().setAttribute("SessionIdWrapper", new 
SessionIdWrapper() );



Then the important class is the HttpSessionBindingListener:

public class SessionIdWrapper implements HttpSessionBindingListener {
private static final int MAX_SESSIONS = 1;
private static int mainSessionCount;
private boolean activeSession;
private Logger log = Logger.getLogger(this.getClass() );

public SessionIdWrapper() { }
synchronized void init(HttpSessionBindingEvent event) {
if ( mainSessionCount < MAX_SESSIONS ) {
mainSessionCount++;
activeSession = true;
event.getSession().getServletContext().setAttribute( 
Constants.APPLICATION_IN_USE,"User" );

} else {
event.getSession().invalidate();
}
}
synchronized void decrement(HttpSessionBindingEvent event) {
mainSessionCount--;
if ( mainSessionCount == 0 ) {
log.debug("Nobody is using the application, so remove 
APPLICATION_IN_USE");


event.getSession().getServletContext().removeAttribute(Constants.APPLICATION_IN_USE); 


}
}


public void valueBound(HttpSessionBindingEvent event) {
init(event);
}

public void valueUnbound(HttpSessionBindingEvent event) {
if ( activeSession ) {
decrement(event);
}
}
}


Finally some work also done in the main Filter filtering all requests. 
If you don't have this, the user will just think his session expired or 
some other odd behavior. Relevant code is in the doFilter:


if ( path.indexOf("/appinuse.jsp") == -1 && path.indexOf("/logout.jsp") 
== -1 ) {
 if (session == null && 
context.getAttribute(Constants.APPLICATION_IN_USE) != null ) {

log.debug("The application is in use");
response.sendRedirect(contextPath+"/appinuse.jsp");
return;
 }
}


In the above you'll notice "context" to get this create class context 
var and in your init method: (thanks to Daniel S. for pointing this out 
to me)


public void init(FilterConfig filterConfig) throws ServletException {
this.context = filterConfig.getServletContext();
}

)

All and all, the above is a bit of work, but not too bad. Although 
looking over my code, I realize that the filter stuff is only going to 
work ok if you only allow one user to use the application (which happens 
to be my criteria). If it is allowed to use say 4 sessions, the above 
filter stuff will be a problem. My head hurts too much to figure out how 
to fix it. Someone email me at [EMAIL PROTECTED] so they can fix it up 
and make the code more robust:)




--
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: [OT] no-cache Actions (or tiles)

2005-07-27 Thread Frank W. Zammetti

Yeah, I know... stop breaking my delusions :)

Dave Newton wrote:

Frank W. Zammetti wrote:


That fact that someone thought there was enough traffic to my projects'
site to warrant buying that domain is rather heartening :)


I don't think that's how it works--they just have sourceforget.

Sorry!

Dave



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



bean traversal question

2005-07-27 Thread Werner Punz

Hi I am banging sort of my head here

I am sort of new to struts (due to project requirements), in every 
webapp you often have the problem of having to pass complex objects over

a handful of forms.

In JSP you only have the option of pushing the object into the session
and fill the data by hand which has changed.
or that you traverse all the data over all forms via hidden fields.

In JSF you have the option in some frameworks to have special constructs
which serialize and restore the objects while filling in the form data 
coming from the request.

(x:saveState from myfaces comes to mind)

this saves a lot of time because you only have to reference the 
component data which actually is used in the form.


I was wondering if there is such a shortcut way in plain struts as well.

If anybody could hint me towards such a solution, I would be grateful.


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



Re: [OT] no-cache Actions (or tiles)

2005-07-27 Thread Dave Newton

Frank W. Zammetti wrote:


That fact that someone thought there was enough traffic to my projects'
site to warrant buying that domain is rather heartening :)


I don't think that's how it works--they just have sourceforget.

Sorry!

Dave



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



Re: [OT] no-cache Actions (or tiles)

2005-07-27 Thread Frank W. Zammetti
That fact that someone thought there was enough traffic to my projects'
site to warrant buying that domain is rather heartening :)

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

On Wed, July 27, 2005 5:26 pm, Neil Erdwien said:
> And the awesome thing is that there *is* a javawebparts.sourceforget.net
> -- it is a generic e-commerce site that generates traffic by using
> commonly-typoed URLs.
>
>
> Jeff Beal wrote:
>> SourceForget - Put up your source and forget it!
>>
>> On 7/27/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
>>
>>>Agh.  Troubleshooting a stupid PDF generation issue all day, my fingers
>>>just won't cooperate :)
>>>
>>>sourceforget... Maybe the French mirror site? ;)
>>>
>>>--
>>>Frank W. Zammetti
>>>Founder and Chief Software Architect
>>>Omnytex Technologies
>>>http://www.omnytex.com
>>>
>>>On Wed, July 27, 2005 4:44 pm, Dave Newton said:
>>>
Frank W. Zammetti wrote:


>Have a look at my CacheControlFilter in Java Web Parts
>(http://javawebparts.sourceforget.net).  It should allow you to do
>exactly
>this, at the path level.
>

Thanks, I'll check it out.

I visit the land of "sourceforget" quite often ;)

Dave



-
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]
>>
>>
>
> --
> Neil Erdwien, [EMAIL PROTECTED], Web Technologies Manager
> Computing and Network Services, Kansas State University
>
> -
> 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: [OT] no-cache Actions (or tiles)

2005-07-27 Thread Neil Erdwien
And the awesome thing is that there *is* a javawebparts.sourceforget.net 
-- it is a generic e-commerce site that generates traffic by using 
commonly-typoed URLs.



Jeff Beal wrote:

SourceForget - Put up your source and forget it!

On 7/27/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:


Agh.  Troubleshooting a stupid PDF generation issue all day, my fingers
just won't cooperate :)

sourceforget... Maybe the French mirror site? ;)

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

On Wed, July 27, 2005 4:44 pm, Dave Newton said:


Frank W. Zammetti wrote:



Have a look at my CacheControlFilter in Java Web Parts
(http://javawebparts.sourceforget.net).  It should allow you to do
exactly
this, at the path level.



Thanks, I'll check it out.

I visit the land of "sourceforget" quite often ;)

Dave



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




--
Neil Erdwien, [EMAIL PROTECTED], Web Technologies Manager
Computing and Network Services, Kansas State University

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



Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread John Henry Xu
Thank Leon and Christopher for java hosting prices.

It seems it is more profitable in Europe. The US site Chris mentioned
uses Tomcat 5.

Leon, what java application softwares do you  provide in addition to the
server softwares? Do you think add EJB support can increase your
profitability?

I am thinking to add user cusomizable java forum, java blogs (like PHP
did)  for their corresonding hosted sites, in addition to EJB, struts,
Jboss, mysql, postgesql support.

Cheers,

John H. Xu
http://www.usanalyst.com
http://www.GetusJobs.com (The largest free job portal in North America)

  - Original Message -
  From: "Christopher Marsh-Bourdon"
  To: "Struts Users Mailing List"
  Subject: Re: JSF is the beginning of the end of Struts !!!
  Date: Wed, 27 Jul 2005 20:28:32 +0100

  >
  > http://www.prokmu.com/
  >
  > After looking at this, my servers are going on eBay! Sometimes it
  > doesn't pay to own your own kit.
  >
  > Cheers
  >
  > Christopher Marsh-Bourdon
  > www.marsh-bourdon.com
  > AIM: marshbourdon
  >
  >
  > On 27 Jul 2005, at 20:08, Leon Rosenberg wrote:
  >
  > >
  > > I charge 15-20 euro / month for an own tomcat, full ssh/scp
  access, apache
  > > in front, mysql dbs, mail server and so on.
  > > 30 euro for a full service package including backups and appl.
  level
  > > support.
  > >
  > > (from 50 euro on you can rent a complete machine at different
  providers in
  > > germany)
  > >
  > > Just for info :-)
  > >
  > > Leon
  > >
  > > P.S. 1 euro is 1.2 USD
  > >
  > >
  > >> -Ursprüngliche Nachricht-
  > >> Von: John Henry Xu [mailto:[EMAIL PROTECTED]
  > >> Gesendet: Mittwoch, 27. Juli 2005 20:18
  > >> An: Struts Users Mailing List
  > >> Betreff: Re: JSF is the beginning of the end of Struts !!!
  > >>
  > >> +1 on Yan Hu, Tamas and Pedro
  > >>
  > >> If one open a web hosting business, what should J2EE hosting
  > >> (including EJB, struts, JSP, servlets, MySQL, PostgreSQL, web
  > >> services on JBoss) charge per month that you are willing to
  > >> pay? What is the market price
  > >> for such hosting now? It seems there is a market there I
  > >> can explore.
  > >>
  > >> Regards,
  > >>
  > >> John H. Xu
  > >>
  > >> http://www.usanalyst.com
  > >> http://www.GetusJobs.com (The largest free job portal in
  > >> North America)
  > >>
  > >> - Original Message -
  > >> From: "Pedro Salgado"
  > >> To: "Struts Users Mailing List"
  > >> Subject: Re: JSF is the beginning of the end of Struts !!!
  > >> Date: Wed, 27 Jul 2005 17:47:20 +0200
  > >>
  > >>
  > >>>
  > >>> +1 for that answer.
  > >>>
  > >>> Pedro Salgado
  > >>>
  > >>> On 27/07/2005 08:15, "Tamas Szabo" wrote:
  > >>>
  > >>>
  >  I wouldn't bet on PHP being more popular than Java webapps.
  > 
  >  I think that there will be more smaller Java webapps if there
  > 
  > >> were much
  > >>
  >  support for them at web hosting companies.
  >  I know several cases when Java webapp programmers, had
  > 
  > >> to use PHP
  > >> to
  > >>
  >  make some smaller webapps for someone because most web hosting
  > 
  > >> companies
  > >>
  >  offer PHP support but they have no
  >  Java webcontainers installed.
  > 
  >  Tamas
  > 
  > 
  > 
  >  Yan Hu wrote:
  > 
  > 
  > > Xu:
  > > One of the reasons why you see a lot of PHP apps is that
  there
  > >
  > >> are always a
  > >>
  > > lot more small apps
  > > than large scale ones. I can not imagin you program a large
  > >
  > >> scale site using
  > >>
  > > PHP. If you are an OO
  > > guy, I could hardly imagin you even would like PHP(mixing all
  > >
  > >> server side
  > >>
  > > code with html code).
  > > There are a lot of java intranet applications you will never
  be
  > >
  > >> able to
  > >>
  > > access. PHP has its niche
  > > in the small app domain. It is fine. But it will never
  > >
  > >> be at the
  > >> same level
  > >>
  > > as Java. I do not
  > > understand why you think PHP is more popular than Java. Let
  me
  > >
  > >> ask you one
  > >>
  > > simple question. Why
  > > are there so many more java jobs than PHP jobs? Anyone
  > >
  > >> will tell
  > >> you it is
  > >>
  > > because there is a lot
  > > more demand for java. So you get the idea. With the advent of
  > >
  > >> JSF, Java will
  > >>
  > > be even sexier. I
  > > have long wished for something like asp.net code behind in
  C#.
  > >
  > >> Now we have
  > >>
  > > JSF code behind in
  > > Java. If asp.net can be a big success, why can't JSF?
  > >
  > >
  > >
  > >
  > >
  > >>
  > >>
  -
  > >>
  > > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > > For additional commands, e-mail: [EMAIL PROTECTED]
  > >
  > >
  > >
  > >
  > >
  > 
  > 
 

Re: [OT] no-cache Actions (or tiles)

2005-07-27 Thread Jeff Beal
SourceForget - Put up your source and forget it!

On 7/27/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> Agh.  Troubleshooting a stupid PDF generation issue all day, my fingers
> just won't cooperate :)
> 
> sourceforget... Maybe the French mirror site? ;)
> 
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> On Wed, July 27, 2005 4:44 pm, Dave Newton said:
> > Frank W. Zammetti wrote:
> >
> >>Have a look at my CacheControlFilter in Java Web Parts
> >>(http://javawebparts.sourceforget.net).  It should allow you to do
> >> exactly
> >>this, at the path level.
> >>
> > Thanks, I'll check it out.
> >
> > I visit the land of "sourceforget" quite often ;)
> >
> > Dave
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Rick Reumann

David G. Friedman wrote the following on 7/27/2005 12:35 AM:


When a session is created, have the SessionListener update a session count.
If the count is 2 or more then call SessionEvent.getSession().invalidate()
to cancel the session.  Then the session listener's Session destroy method
can decrement the counter appropriately.   And once the main session is
removed (via logout or timeout) it would set the session count back to zero
so someone new could login to the webapp.  But it sounds like Rick found
some issues with that kind of approach where it doesn't match that simple
kind of logic.


I tried something like the above but there was a problem. The problem 
was that the Session destroy method that decrements the counter gets 
called whenever session.invalidate() is called, so say the first person 
logs in... the static counter goes to "1." Now another person tries to 
login and the session listener sees that it's "1" so it calls 
invalidate. Now you just set it back to 0 so another follow up session 
will think it's ok to login when it isn't.


I used your suggestion though David and did something similar but in a 
HttpSessionBindingListener (code will be shown below).


It still does also require a SessionListener and in 
sessionCreated(HttpSessionEvent event)


event.getSession().setAttribute("SessionIdWrapper", new 
SessionIdWrapper() );



Then the important class is the HttpSessionBindingListener:

public class SessionIdWrapper implements HttpSessionBindingListener {
private static final int MAX_SESSIONS = 1;
private static int mainSessionCount;
private boolean activeSession;
private Logger log = Logger.getLogger(this.getClass() );

public SessionIdWrapper() { }
synchronized void init(HttpSessionBindingEvent event) {
if ( mainSessionCount < MAX_SESSIONS ) {
mainSessionCount++;
activeSession = true;
event.getSession().getServletContext().setAttribute( 
Constants.APPLICATION_IN_USE,"User" );

} else {
event.getSession().invalidate();
}
}
synchronized void decrement(HttpSessionBindingEvent event) {
mainSessionCount--;
if ( mainSessionCount == 0 ) {
log.debug("Nobody is using the application, so remove 
APPLICATION_IN_USE");


event.getSession().getServletContext().removeAttribute(Constants.APPLICATION_IN_USE);
}
}


public void valueBound(HttpSessionBindingEvent event) {
init(event);
}

public void valueUnbound(HttpSessionBindingEvent event) {
if ( activeSession ) {
decrement(event);
}
}
}


Finally some work also done in the main Filter filtering all requests. 
If you don't have this, the user will just think his session expired or 
some other odd behavior. Relevant code is in the doFilter:


if ( path.indexOf("/appinuse.jsp") == -1 && path.indexOf("/logout.jsp") 
== -1 ) {
 if (session == null && 
context.getAttribute(Constants.APPLICATION_IN_USE) != null ) {

log.debug("The application is in use");
response.sendRedirect(contextPath+"/appinuse.jsp");
return;
 }
}


In the above you'll notice "context" to get this create class context 
var and in your init method: (thanks to Daniel S. for pointing this out 
to me)


public void init(FilterConfig filterConfig) throws ServletException {
this.context = filterConfig.getServletContext();
}

)

All and all, the above is a bit of work, but not too bad. Although 
looking over my code, I realize that the filter stuff is only going to 
work ok if you only allow one user to use the application (which happens 
to be my criteria). If it is allowed to use say 4 sessions, the above 
filter stuff will be a problem. My head hurts too much to figure out how 
to fix it. Someone email me at [EMAIL PROTECTED] so they can fix it up 
and make the code more robust:)


--
Rick

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



RE: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Danilo Gurovich
JSF is very nice for web applications that release on a more-than-quarterly 
basis.  The front-end gui widgets packed with it are nothing short of really 
basic HTML coding that most good coders would blush at.  Custom widgets need to 
be developed for real clean front-end functionality, and MyFaces has only 
limited support in this area, just as Struts-Layout does with "Struts" widgets.

I work in an eCommerce setting where the skill-sets, mind-sets and code-base 
are somewhat different from pure application development;  we release on a 
weekly basis, 90% of development is done at the front-end and is quite granular 
in nature.  The inflexibility of JSF in this area really shows something to me. 
 Struts and JSTL allow for much more granularity in this arena, better 
javascript support and allows for a less-than-optimal codebase to migrate to 
something better.  JSF in my opinion, is very intolerant with respect to this, 
as our test examples have proven to our team.  The biggest problem we've had 
with JSF is in our continuing and rapid changes needed to the UI and the need 
for major code changes in JSF to get the same thing that a few small changes to 
a JSP page can deliver (means that redeployment is low-risk).

Maybe some of you have a very stable, new and efficient eCommerce site that is 
high-transaction, enterprise-level and profitable, but my spies at most sites 
like these report the same findings.

I like the structure and framework that JSF proposes, but it's a long way from 
the rapid-release eCommerce Enterprise, as far as I see it.


Danilo Gurovich
Architect
LowerMyBills.com
[EMAIL PROTECTED]
2401 Colorado Ave., 2nd Floor 
Santa Monica, CA 90404
(310) 998-6412

 


-Original Message-
From: Leon Rosenberg [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 27, 2005 12:09 PM
To: 'Struts Users Mailing List'
Subject: re: JSF is the beginning of the end of Struts !!!

 
I charge 15-20 euro / month for an own tomcat, full ssh/scp access, apache in 
front, mysql dbs, mail server and so on.
30 euro for a full service package including backups and appl. level support.

(from 50 euro on you can rent a complete machine at different providers in
germany)

Just for info :-)

Leon

P.S. 1 euro is 1.2 USD

> -Ursprüngliche Nachricht-
> Von: John Henry Xu [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 27. Juli 2005 20:18
> An: Struts Users Mailing List
> Betreff: Re: JSF is the beginning of the end of Struts !!!
> 
> +1 on Yan Hu, Tamas and Pedro
> 
> If one open a web hosting business, what should J2EE hosting 
> (including EJB, struts, JSP, servlets, MySQL, PostgreSQL, web services 
> on JBoss) charge per month that you are willing to pay? What is the 
> market price
> for such hosting now?   It seems there is a market there I 
> can explore.
> 
> Regards,
> 
> John H. Xu
> 
> http://www.usanalyst.com
> http://www.GetusJobs.com (The largest free job portal in North 
> America)
> 
>   - Original Message -
>   From: "Pedro Salgado"
>   To: "Struts Users Mailing List"
>   Subject: Re: JSF is the beginning of the end of Struts !!!
>   Date: Wed, 27 Jul 2005 17:47:20 +0200
> 
>   >
>   > +1 for that answer.
>   >
>   > Pedro Salgado
>   >
>   > On 27/07/2005 08:15, "Tamas Szabo" wrote:
>   >
>   > > I wouldn't bet on PHP being more popular than Java webapps.
>   > >
>   > > I think that there will be more smaller Java webapps if there
>   were much
>   > > support for them at web hosting companies.
>   > > I know several cases when Java webapp programmers, had to use 
> PHP
>   to
>   > > make some smaller webapps for someone because most web hosting
>   companies
>   > > offer PHP support but they have no
>   > > Java webcontainers installed.
>   > >
>   > > Tamas
>   > >
>   > >
>   > >
>   > > Yan Hu wrote:
>   > >
>   > >> Xu:
>   > >> One of the reasons why you see a lot of PHP apps is that there
>   are always a
>   > >> lot more small apps
>   > >> than large scale ones. I can not imagin you program a large
>   scale site using
>   > >> PHP. If you are an OO
>   > >> guy, I could hardly imagin you even would like PHP(mixing all
>   server side
>   > >> code with html code).
>   > >> There are a lot of java intranet applications you will never be
>   able to
>   > >> access. PHP has its niche
>   > >> in the small app domain. It is fine. But it will never be at 
> the
>   same level
>   > >> as Java. I do not
>   > >> understand why you think PHP is more popular than Java. Let me
>   ask you one
>   > >> simple question. Why
>   > >> are there so many more java jobs than PHP jobs? Anyone will 
> tell
>   you it is
>   > >> because there is a lot
>   > >> more demand for java. So you get the idea. With the advent of
>   JSF, Java will
>   > >> be even sexier. I
>   > >> have long wished for something like asp.net code behind in C#.
>   Now we have
>   > >> JSF code behind in
>   > >> Java. If asp.net can be a big success, why can't JSF?
>   > >>
>   > >>
>   > >>
>   > >>
>   
> 

Re: [OT] no-cache Actions (or tiles)

2005-07-27 Thread Frank W. Zammetti
Agh.  Troubleshooting a stupid PDF generation issue all day, my fingers
just won't cooperate :)

sourceforget... Maybe the French mirror site? ;)

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

On Wed, July 27, 2005 4:44 pm, Dave Newton said:
> Frank W. Zammetti wrote:
>
>>Have a look at my CacheControlFilter in Java Web Parts
>>(http://javawebparts.sourceforget.net).  It should allow you to do
>> exactly
>>this, at the path level.
>>
> Thanks, I'll check it out.
>
> I visit the land of "sourceforget" quite often ;)
>
> Dave
>
>
>
> -
> 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: [OT] no-cache Actions (or tiles)

2005-07-27 Thread Dave Newton

Frank W. Zammetti wrote:


Have a look at my CacheControlFilter in Java Web Parts
(http://javawebparts.sourceforget.net).  It should allow you to do exactly
this, at the path level.


Thanks, I'll check it out.

I visit the land of "sourceforget" quite often ;)

Dave



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



Re: [OT] no-cache Actions (or tiles)

2005-07-27 Thread Frank W. Zammetti
Have a look at my CacheControlFilter in Java Web Parts
(http://javawebparts.sourceforget.net).  It should allow you to do exactly
this, at the path level.

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

On Wed, July 27, 2005 4:36 pm, Dave Newton said:
> Howdy,
>
> As part of a struts-workflow-like requirement, I need to mark specific
> actions (forwards or tiles, perhaps?) as non-cacheable.
>
> All my tiles subclass a single base layout tile, so I could conceivably
> put no-cache junk in there based on a tile property, although I kinda
> hate to put that stuff in a JSP--I'd rather handle it elsewhere, but I'm
> not sure where the best place to do this would be.
>
> Is there a canonical way to do this?
>
> Thanks,
> Dave
>
>
>
> -
> 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]



[OT] no-cache Actions (or tiles)

2005-07-27 Thread Dave Newton

Howdy,

As part of a struts-workflow-like requirement, I need to mark specific 
actions (forwards or tiles, perhaps?) as non-cacheable.


All my tiles subclass a single base layout tile, so I could conceivably 
put no-cache junk in there based on a tile property, although I kinda 
hate to put that stuff in a JSP--I'd rather handle it elsewhere, but I'm 
not sure where the best place to do this would be.


Is there a canonical way to do this?

Thanks,
Dave



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



Re: [OT] Create/Edit Form

2005-07-27 Thread Michael Jouravlev
On 7/27/05, Andrew Tomaka <[EMAIL PROTECTED]> wrote:
> I realized the
> problem was actually a bit more complex than I was making it.  The
> database table I am editing requires two primary keys to make an entry
> unique (I'm a firm believer in a single PRImary key, but it wasn't my
> choice).  

Are you are talking about a composite PK?

> One of the two keys can be changed by this form, so it
> causes problems.

It is usually a bad idea to use domain data as PK. Having modifiable
PKs is [generally] one of the worst ideas.

Michael.

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



Re: [OT] Create/Edit Form

2005-07-27 Thread Andrew Tomaka
I really like your Javascript solution, Kevin. However, I realized the
problem was actually a bit more complex than I was making it.  The
database table I am editing requires two primary keys to make an entry
unique (I'm a firm believer in a single PRImary key, but it wasn't my
choice).  One of the two keys can be changed by this form, so it
causes problems. I came up with a few solutions, but in the end, we
decided it would be easist (quick but dirty) to go ahead and just
delete all rows associated with the document and then reinsert them.
This way, we are sure to get the exact information that we want from
the users.

Thanks a lot for the quick responses guys.  I'll definitely keep the
JS flag tucked away in the back of my mind.

~ Andrew Tomaka

On 7/27/05, Andrew Tomaka <[EMAIL PROTECTED]> wrote:
> Hey all,
> 
> The following is pretty hard to understand.  I'm no good at describing
> my problems and wasn't sure how to explain it.  Hopefully, someone
> will get what I'm attempting to say
> 
> I'm working on a screen that allows a user to dynamically add rows via
> Javascript. I then have have a form that contains a list of beans that
> stores the data (but that's really beside the point).
> 
> My issue comes with the storage of this information.  The form can
> either be a blank form or it can be preloaded with other information
> depending on whether the record exists or not.  If it is preloaded,
> the user can edit the existing rows or add new rows.  The problem
> comes when I need to update the database.  When the user hits the save
> button, it submits all the information, but I have no way of telling
> if a specific row was edited or created. Because of this, I don't know
> whether to make an UPDATE query or an INSERT query.  Can anyone think
> of a creative way to do this without adding an extra query for each
> row?
> 
> Any insight would be greatly appreciated!
> 
> Thanks,
> ~ Andrew Tomaka
>

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



Re: [OT] Force URLEncoder to use %20 instead of + for spaces

2005-07-27 Thread Laurie Harper
Interestingly, I found the same problem occurs with Firefox on the Mac, so 
this isn't an IE thing. I'll have to investigate why it's a problem, but 
I'm glad you found a solution.


L.

Neil Aggarwal wrote:


Laurie:

FYI, I got a response from someone on comp.lang.java.programmer.
They suggested using the java.net.URI class.
I tried it and it works perfectly.

Thanks,
Neil


--
Neil Aggarwal, JAMM Consulting, (214) 986-3533, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by
17% or more in 6 months or less! http://newsletter.JAMMConsulting.com



-Original Message-
From: Neil Aggarwal [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 26, 2005 9:38 PM

To: 'Struts Users Mailing List'
Subject: RE: [OT] Force URLEncoder to use %20 instead of + for spaces


Laurie:

Did you try these two URLs I put in my email?

Why does this fail:
http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping+G2
+Driver.gif

and this one work:
http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping%20
G2%20Driver.gi
f

Any ideas?

Thanks,
Neil

--
Neil Aggarwal, JAMM Consulting, (214) 986-3533, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by
17% or more in 6 months or less! http://newsletter.JAMMConsulting.com



-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Tuesday, July 26, 2005 5:12 PM
To: user@struts.apache.org
Subject: Re: [OT] Force URLEncoder to use %20 instead of + 


for spaces



Neil Aggarwal wrote:


Hello:

When I encode the name of an image file to place into a 


URL, I use this


code:

URLEncoder.encode(imageName,"UTF-8")

This gives me image names with spaces replaced by + signs 


which IE does not

like. 


If I change the spaces to %20, the URL works perfectly in IE.

For example, if my image name is Ping G2 Driver.gif, 


URLEncoder gives me


this URL:





http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping+G2


+Driver.gif


If I try to load this URL in IE, it gives me a 404 error.

If I use the exact same url with %20, it works just fine:







http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping%20
G2%20Driver.gi


f

I thought + and %20 were both acceptable for spaces in a URL, but


apparently

IE does not like the plus signs.  


Is there a way to force URLEncoder to use %20 instead of + signs?


Nope. '+' is canonical and should work fine. What encoding 
are you sending 
your pages with? That's the only thing I can think of that 
might make a 
difference.


L.
--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


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




--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


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



Re: [OT] Create/Edit Form

2005-07-27 Thread Ed Griebel
Andrew-

At some point, you're probably going to need to know which records
have been changed and which ones haven't. If the dataset isn't too
big, you could add a collection (java.util.List, etc.) of records that
you are displaying, and store it either as a formbean attribute or in
the session. If these records and/or lists are big, you will run into
problems with either method, but then is a user really going to want
to be able to edit hundreds of records anyway?

-ed

On 7/27/05, Simons Kevin <[EMAIL PROTECTED]> wrote:
> Just a suggestion,
> 
> If you do the rows by javascript you can add a hidden field which can have a
> value (eg 0 for update 1 for creation)
> 
> Regards,
> Kevin
> - Original Message -
> From: "Andrew Tomaka" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Sent: Wednesday, July 27, 2005 9:47 PM
> Subject: [OT] Create/Edit Form
> 
> 
> > Hey all,
> >
> > The following is pretty hard to understand.  I'm no good at describing
> > my problems and wasn't sure how to explain it.  Hopefully, someone
> > will get what I'm attempting to say
> >
> > I'm working on a screen that allows a user to dynamically add rows via
> > Javascript. I then have have a form that contains a list of beans that
> > stores the data (but that's really beside the point).
> >
> > My issue comes with the storage of this information.  The form can
> > either be a blank form or it can be preloaded with other information
> > depending on whether the record exists or not.  If it is preloaded,
> > the user can edit the existing rows or add new rows.  The problem
> > comes when I need to update the database.  When the user hits the save
> > button, it submits all the information, but I have no way of telling
> > if a specific row was edited or created. Because of this, I don't know
> > whether to make an UPDATE query or an INSERT query.  Can anyone think
> > of a creative way to do this without adding an extra query for each
> > row?
> >
> > Any insight would be greatly appreciated!
> >
> > Thanks,
> > ~ Andrew Tomaka
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.338 / Virus Database: 267.9.5/58 - Release Date: 25/07/2005
> >
> >
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.9.5/58 - Release Date: 25/07/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]



Re: newbie...but not stupid...so I thought

2005-07-27 Thread Dave Newton

Chris Pat wrote:


The NPE is happening on the first cast.  Everything
else looks fine.  


But WE wouldn't know that 'cuz you keep not giving us info.


 
   
   
 
 


That seems fine.


 
   
   
   
 
   
   
   
 
   
 
 


Here I start to get suspicious.

Your original code sample you said didn't work was a fragment of 
search1Action, correct?


You do not have a form bean defined for the /search1Action path, which 
is the only place search1Action is referenced in the above config fragment.


Have you tried defining the form bean for that action? You have to 
provide the name of the bean for the action, otherwise how would it know 
what type of form to put in to scope?


Dave



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



Re: [OT] Create/Edit Form

2005-07-27 Thread Simons Kevin

Just a suggestion,

If you do the rows by javascript you can add a hidden field which can have a 
value (eg 0 for update 1 for creation)


Regards,
Kevin
- Original Message - 
From: "Andrew Tomaka" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Wednesday, July 27, 2005 9:47 PM
Subject: [OT] Create/Edit Form



Hey all,

The following is pretty hard to understand.  I'm no good at describing
my problems and wasn't sure how to explain it.  Hopefully, someone
will get what I'm attempting to say

I'm working on a screen that allows a user to dynamically add rows via
Javascript. I then have have a form that contains a list of beans that
stores the data (but that's really beside the point).

My issue comes with the storage of this information.  The form can
either be a blank form or it can be preloaded with other information
depending on whether the record exists or not.  If it is preloaded,
the user can edit the existing rows or add new rows.  The problem
comes when I need to update the database.  When the user hits the save
button, it submits all the information, but I have no way of telling
if a specific row was edited or created. Because of this, I don't know
whether to make an UPDATE query or an INSERT query.  Can anyone think
of a creative way to do this without adding an extra query for each
row?

Any insight would be greatly appreciated!

Thanks,
~ Andrew Tomaka

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





--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.5/58 - Release Date: 25/07/2005






--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.5/58 - Release Date: 25/07/2005


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



[OT] Create/Edit Form

2005-07-27 Thread Andrew Tomaka
Hey all,

The following is pretty hard to understand.  I'm no good at describing
my problems and wasn't sure how to explain it.  Hopefully, someone
will get what I'm attempting to say

I'm working on a screen that allows a user to dynamically add rows via
Javascript. I then have have a form that contains a list of beans that
stores the data (but that's really beside the point).

My issue comes with the storage of this information.  The form can
either be a blank form or it can be preloaded with other information
depending on whether the record exists or not.  If it is preloaded,
the user can edit the existing rows or add new rows.  The problem
comes when I need to update the database.  When the user hits the save
button, it submits all the information, but I have no way of telling
if a specific row was edited or created. Because of this, I don't know
whether to make an UPDATE query or an INSERT query.  Can anyone think
of a creative way to do this without adding an extra query for each
row?

Any insight would be greatly appreciated!

Thanks,
~ Andrew Tomaka

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



RE: newbie...but not stupid...so I thought

2005-07-27 Thread Scott Piker
You're not specifying the form name in your action definitions.  Not
sure which action you're attempting to call, but add name="yourFormName"
to that action.


> -Original Message-
> From: Chris Pat [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 27, 2005 3:38 PM
> To: Struts Users Mailing List
> Subject: Re: newbie...but not stupid...so I thought
> 
> Hi Dave
> I second your analogies, grin.
> The NPE is happening on the first cast.  Everything
> else looks fine.  The fb is standard set/get made by
> JB05 wizard and looks normal.  The struts-config has
> all the proper syntax for the required elements but in
> weird order, but there.  Here it is. I am nonplused.
> 
> ?xml version="1.0" encoding="UTF-8"?>
>  Foundation//DTD Struts Configuration 1.1//EN"
> "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>
> 
>   
>  type="min03.forms.header1" />
>  type="min03.forms.header1Form" />
>   
>   
>  scope="session" type="min03.actions.add1Action" />
>  type="min03.actions.delete1Action" />
>  path="/header1Action" scope="session"
> type="min03.actions.header1Action">
>/>
> 
>  type="min03.actions.listAll1Action" />
>  scope="session" type="min03.actions.search1Action">
>/>
> 
>   
> 
> 
> 
> 
> --- Dave Newton <[EMAIL PROTECTED]> wrote:
> 
> > Chris Pat wrote:
> > 
> > >That is just a leftover.  The retrieved form value
> > is
> > >from the fast of the passed in form bean.
> > >  
> > >
> > Yeah, but where is the NPE happenning?
> > 
> > What does the ActionForm look like?
> > 
> > What does the struts config look like?
> > 
> > It's "fastiduous" because non-fastiduous webapps
> > rarely work. Maybe you 
> > meant "irritating and repetitive?"
> > 
> > That's because Java and XML is like crack for people
> > that like to type ;)
> > 
> > Dave
> > 
> > 
> > 
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> > 
> 
> 
> 
> 
> 
>   
> 
> Start your day with Yahoo! - make it your home page 
> http://www.yahoo.com/r/hs 
>  
> 
> -
> 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: newbie...but not stupid...so I thought

2005-07-27 Thread Chris Pat
Hi Dave
I second your analogies, grin.
The NPE is happening on the first cast.  Everything
else looks fine.  The fb is standard set/get made by
JB05 wizard and looks normal.  The struts-config has
all the proper syntax for the required elements but in
weird order, but there.  Here it is. I am nonplused.

?xml version="1.0" encoding="UTF-8"?>
http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>

  


  
  



  



  

  




--- Dave Newton <[EMAIL PROTECTED]> wrote:

> Chris Pat wrote:
> 
> >That is just a leftover.  The retrieved form value
> is
> >from the fast of the passed in form bean.
> >  
> >
> Yeah, but where is the NPE happenning?
> 
> What does the ActionForm look like?
> 
> What does the struts config look like?
> 
> It's "fastiduous" because non-fastiduous webapps
> rarely work. Maybe you 
> meant "irritating and repetitive?"
> 
> That's because Java and XML is like crack for people
> that like to type ;)
> 
> Dave
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 







Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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



Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Christopher Marsh-Bourdon

http://www.prokmu.com/

After looking at this, my servers are going on eBay!  Sometimes it  
doesn't pay to own your own kit.


Cheers

Christopher Marsh-Bourdon
www.marsh-bourdon.com
AIM: marshbourdon


On 27 Jul 2005, at 20:08, Leon Rosenberg wrote:



I charge 15-20 euro / month for an own tomcat, full ssh/scp access,  
apache

in front, mysql dbs, mail server and so on.
30 euro for a full service package including backups and appl. level
support.

(from 50 euro on you can rent a complete machine at different  
providers in

germany)

Just for info :-)

Leon

P.S. 1 euro is 1.2 USD



-Ursprüngliche Nachricht-
Von: John Henry Xu [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 27. Juli 2005 20:18
An: Struts Users Mailing List
Betreff: Re: JSF is the beginning of the end of Struts !!!

+1 on Yan Hu, Tamas and Pedro

If one open a web hosting business, what should J2EE hosting
(including EJB, struts, JSP, servlets, MySQL, PostgreSQL, web
services on JBoss) charge per month that you are willing to
pay? What is the market price
for such hosting now?   It seems there is a market there I
can explore.

Regards,

John H. Xu

http://www.usanalyst.com
http://www.GetusJobs.com (The largest free job portal in
North America)

  - Original Message -
  From: "Pedro Salgado"
  To: "Struts Users Mailing List"
  Subject: Re: JSF is the beginning of the end of Struts !!!
  Date: Wed, 27 Jul 2005 17:47:20 +0200




+1 for that answer.

Pedro Salgado

On 27/07/2005 08:15, "Tamas Szabo" wrote:



I wouldn't bet on PHP being more popular than Java webapps.

I think that there will be more smaller Java webapps if there


  were much


support for them at web hosting companies.
I know several cases when Java webapp programmers, had


to use PHP
  to


make some smaller webapps for someone because most web hosting


  companies


offer PHP support but they have no
Java webcontainers installed.

Tamas



Yan Hu wrote:



Xu:
One of the reasons why you see a lot of PHP apps is that there


  are always a


lot more small apps
than large scale ones. I can not imagin you program a large


  scale site using


PHP. If you are an OO
guy, I could hardly imagin you even would like PHP(mixing all


  server side


code with html code).
There are a lot of java intranet applications you will never be


  able to


access. PHP has its niche
in the small app domain. It is fine. But it will never


be at the
  same level


as Java. I do not
understand why you think PHP is more popular than Java. Let me


  ask you one


simple question. Why
are there so many more java jobs than PHP jobs? Anyone


will tell
  you it is


because there is a lot
more demand for java. So you get the idea. With the advent of


  JSF, Java will


be even sexier. I
have long wished for something like asp.net code behind in C#.


  Now we have


JSF code behind in
Java. If asp.net can be a big success, why can't JSF?







-


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]








Jack H. Xu
Technology columnist and editor

http://www.usanalyst.com

http://www.getusjobs.com (The largest free job portal in
North America)

--
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm







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







Re: newbie...but not stupid...so I thought

2005-07-27 Thread Ed Griebel
Well, if all these things are true, then you are indeed correct and
everything should work fine. Which it doesn't. Which means that there
is a problem somewhere, possibly in something assumed to be correct.
The code you have below is dead-simple, so it's got to be something in
the configuration or form beans or something else not seen here.

For me, when I've checked everything and everything should work and it
doesn't, I've found the problem to be either an incorrect assumption
or I don't understand things as well as I thought I did.

Fastidious ("careful attention to details")? Hmm, maybe "tedious," or
better yet "capricious" !!:-)

-ed

On 7/27/05, Chris Pat <[EMAIL PROTECTED]> wrote:
> Hi Ed
> Thanks.  I will look again at typos, however the
> action mapping properly has the name element in it for
> the form bean and the form beans element has the
> proper syntax.  Except for the stylistic issues, if
> all else is correct this should work fine, correct?
> Why is this so mind-numbingly fastidious, even with
> the "tools".
> 
> --- Ed Griebel <[EMAIL PROTECTED]> wrote:
> 
> > In search1Action, is the whole form null? Without
> > seeing the relevant
> > parts of struts-config nor the form bean
> > declaration, I can only
> > guess. There could be a typo in your struts-config
> > for the action or
> > the form bean getter/setter declaration. Also, this
> > isn't causing your
> > problem, but you assign your form to header1Form_
> > but then continue to
> > use a cast with the original form when you could
> > just use the
> > header1form_ instance variable without a cast.
> >
> > Also, a style point, by convention the names of
> > classes are capitalized in Java.
> >
> > -ed
> >
> > On 7/27/05, Chris Pat <[EMAIL PROTECTED]> wrote:
> > > Hello
> > > I have been trying for too long to get this simply
> > to
> > > work.  Below is very simple code that fails at the
> > > first attempt to retrieve the form bean method.
> > What
> > > can possibly be wrong, it gives compiles, gives a
> > NPE.
> > >  The form bean variables are ="" in the reset
> > method.
> > > I do know how to do it as the example further
> > below
> > > works fine.  Please advise.
> > >
> > > public class search1Action extends Action {
> > > public ActionForward execute(ActionMapping
> > > actionMapping,
> > >  ActionForm form,
> > >
> > HttpServletRequest
> > > request,
> > >
> > HttpServletResponse
> > > response) {
> > > header1Form header1Form_ = (header1Form)
> > form;
> > > String queryString =
> > > ((header1Form)form).getQuery();
> > > String animalType =
> > > ((header1Form)form).getAnimalType();
> > >
> > > This works fine:
> > > public class min01Action extends Action {
> > > public ActionForward execute(ActionMapping
> > > actionMapping,
> > >  ActionForm form,
> > >
> > HttpServletRequest
> > > request,
> > >
> > HttpServletResponse
> > > response) {
> > >
> > > min01Form min01Form_ = (min01Form)form;
> > > String fromAction =
> > > ((min01Form)form).getSample().toUpperCase();
> > > String fromAction2 =
> > > ((min01Form)form).getSample2().toUpperCase();
> > > HttpSession session =
> > request.getSession();
> > >
> > session.setAttribute("fromAction",fromAction);
> > >
> > > session.setAttribute("fromAction2",fromAction2);
> > > return
> > (actionMapping.findForward("success"));
> > > }
> > > }
> > >
> > > __
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.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]
> >
> >
> 
> 
> 
> 
> 
> Start your day with Yahoo! - make it your home page
> http://www.yahoo.com/r/hs
> 
>

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



re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Leon Rosenberg
 
I charge 15-20 euro / month for an own tomcat, full ssh/scp access, apache
in front, mysql dbs, mail server and so on.
30 euro for a full service package including backups and appl. level
support.

(from 50 euro on you can rent a complete machine at different providers in
germany)

Just for info :-)

Leon

P.S. 1 euro is 1.2 USD

> -Ursprüngliche Nachricht-
> Von: John Henry Xu [mailto:[EMAIL PROTECTED] 
> Gesendet: Mittwoch, 27. Juli 2005 20:18
> An: Struts Users Mailing List
> Betreff: Re: JSF is the beginning of the end of Struts !!!
> 
> +1 on Yan Hu, Tamas and Pedro
> 
> If one open a web hosting business, what should J2EE hosting 
> (including EJB, struts, JSP, servlets, MySQL, PostgreSQL, web 
> services on JBoss) charge per month that you are willing to 
> pay? What is the market price
> for such hosting now?   It seems there is a market there I 
> can explore.
> 
> Regards,
> 
> John H. Xu
> 
> http://www.usanalyst.com
> http://www.GetusJobs.com (The largest free job portal in 
> North America)
> 
>   - Original Message -
>   From: "Pedro Salgado"
>   To: "Struts Users Mailing List"
>   Subject: Re: JSF is the beginning of the end of Struts !!!
>   Date: Wed, 27 Jul 2005 17:47:20 +0200
> 
>   >
>   > +1 for that answer.
>   >
>   > Pedro Salgado
>   >
>   > On 27/07/2005 08:15, "Tamas Szabo" wrote:
>   >
>   > > I wouldn't bet on PHP being more popular than Java webapps.
>   > >
>   > > I think that there will be more smaller Java webapps if there
>   were much
>   > > support for them at web hosting companies.
>   > > I know several cases when Java webapp programmers, had 
> to use PHP
>   to
>   > > make some smaller webapps for someone because most web hosting
>   companies
>   > > offer PHP support but they have no
>   > > Java webcontainers installed.
>   > >
>   > > Tamas
>   > >
>   > >
>   > >
>   > > Yan Hu wrote:
>   > >
>   > >> Xu:
>   > >> One of the reasons why you see a lot of PHP apps is that there
>   are always a
>   > >> lot more small apps
>   > >> than large scale ones. I can not imagin you program a large
>   scale site using
>   > >> PHP. If you are an OO
>   > >> guy, I could hardly imagin you even would like PHP(mixing all
>   server side
>   > >> code with html code).
>   > >> There are a lot of java intranet applications you will never be
>   able to
>   > >> access. PHP has its niche
>   > >> in the small app domain. It is fine. But it will never 
> be at the
>   same level
>   > >> as Java. I do not
>   > >> understand why you think PHP is more popular than Java. Let me
>   ask you one
>   > >> simple question. Why
>   > >> are there so many more java jobs than PHP jobs? Anyone 
> will tell
>   you it is
>   > >> because there is a lot
>   > >> more demand for java. So you get the idea. With the advent of
>   JSF, Java will
>   > >> be even sexier. I
>   > >> have long wished for something like asp.net code behind in C#.
>   Now we have
>   > >> JSF code behind in
>   > >> Java. If asp.net can be a big success, why can't JSF?
>   > >>
>   > >>
>   > >>
>   > >>
>   
> -
>   > >> 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]
> 
> 
> 
> 
> 
> 
> Jack H. Xu
> Technology columnist and editor
> 
> http://www.usanalyst.com
> 
> http://www.getusjobs.com (The largest free job portal in 
> North America)
> 
> --
> ___
> Sign-up for Ads Free at Mail.com
> http://promo.mail.com/adsfreejump.htm
> 
> 



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



re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Leon Rosenberg
 
I charge 15-20 euro / month for an own tomcat, full ssh/scp access, apache
in front, mysql dbs, mail server and so on.
30 euro for a full service package including backups and appl. level
support.

(from 50 euro on you can rent a complete machine at different providers in
germany)

Just for info :-)

Leon

P.S. 1 euro is 1.2 USD

> -Ursprüngliche Nachricht-
> Von: John Henry Xu [mailto:[EMAIL PROTECTED] 
> Gesendet: Mittwoch, 27. Juli 2005 20:18
> An: Struts Users Mailing List
> Betreff: Re: JSF is the beginning of the end of Struts !!!
> 
> +1 on Yan Hu, Tamas and Pedro
> 
> If one open a web hosting business, what should J2EE hosting 
> (including EJB, struts, JSP, servlets, MySQL, PostgreSQL, web 
> services on JBoss) charge per month that you are willing to 
> pay? What is the market price
> for such hosting now?   It seems there is a market there I 
> can explore.
> 
> Regards,
> 
> John H. Xu
> 
> http://www.usanalyst.com
> http://www.GetusJobs.com (The largest free job portal in 
> North America)
> 
>   - Original Message -
>   From: "Pedro Salgado"
>   To: "Struts Users Mailing List"
>   Subject: Re: JSF is the beginning of the end of Struts !!!
>   Date: Wed, 27 Jul 2005 17:47:20 +0200
> 
>   >
>   > +1 for that answer.
>   >
>   > Pedro Salgado
>   >
>   > On 27/07/2005 08:15, "Tamas Szabo" wrote:
>   >
>   > > I wouldn't bet on PHP being more popular than Java webapps.
>   > >
>   > > I think that there will be more smaller Java webapps if there
>   were much
>   > > support for them at web hosting companies.
>   > > I know several cases when Java webapp programmers, had 
> to use PHP
>   to
>   > > make some smaller webapps for someone because most web hosting
>   companies
>   > > offer PHP support but they have no
>   > > Java webcontainers installed.
>   > >
>   > > Tamas
>   > >
>   > >
>   > >
>   > > Yan Hu wrote:
>   > >
>   > >> Xu:
>   > >> One of the reasons why you see a lot of PHP apps is that there
>   are always a
>   > >> lot more small apps
>   > >> than large scale ones. I can not imagin you program a large
>   scale site using
>   > >> PHP. If you are an OO
>   > >> guy, I could hardly imagin you even would like PHP(mixing all
>   server side
>   > >> code with html code).
>   > >> There are a lot of java intranet applications you will never be
>   able to
>   > >> access. PHP has its niche
>   > >> in the small app domain. It is fine. But it will never 
> be at the
>   same level
>   > >> as Java. I do not
>   > >> understand why you think PHP is more popular than Java. Let me
>   ask you one
>   > >> simple question. Why
>   > >> are there so many more java jobs than PHP jobs? Anyone 
> will tell
>   you it is
>   > >> because there is a lot
>   > >> more demand for java. So you get the idea. With the advent of
>   JSF, Java will
>   > >> be even sexier. I
>   > >> have long wished for something like asp.net code behind in C#.
>   Now we have
>   > >> JSF code behind in
>   > >> Java. If asp.net can be a big success, why can't JSF?
>   > >>
>   > >>
>   > >>
>   > >>
>   
> -
>   > >> 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]
> 
> 
> 
> 
> 
> 
> Jack H. Xu
> Technology columnist and editor
> 
> http://www.usanalyst.com
> 
> http://www.getusjobs.com (The largest free job portal in 
> North America)
> 
> --
> ___
> Sign-up for Ads Free at Mail.com
> http://promo.mail.com/adsfreejump.htm
> 
> 



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



Re: newbie...but not stupid...so I thought

2005-07-27 Thread Ed Griebel
> 
> That's because Java and XML is like crack for people that like to type ;)
> 
> Dave

LOL!!!

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



Re: newbie...but not stupid...so I thought

2005-07-27 Thread Dave Newton

Chris Pat wrote:


That is just a leftover.  The retrieved form value is
from the fast of the passed in form bean.
 


Yeah, but where is the NPE happenning?

What does the ActionForm look like?

What does the struts config look like?

It's "fastiduous" because non-fastiduous webapps rarely work. Maybe you 
meant "irritating and repetitive?"


That's because Java and XML is like crack for people that like to type ;)

Dave



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



Re: newbie...but not stupid...so I thought

2005-07-27 Thread Chris Pat
Hi Ed
Thanks.  I will look again at typos, however the
action mapping properly has the name element in it for
the form bean and the form beans element has the
proper syntax.  Except for the stylistic issues, if
all else is correct this should work fine, correct? 
Why is this so mind-numbingly fastidious, even with
the "tools".

--- Ed Griebel <[EMAIL PROTECTED]> wrote:

> In search1Action, is the whole form null? Without
> seeing the relevant
> parts of struts-config nor the form bean
> declaration, I can only
> guess. There could be a typo in your struts-config
> for the action or
> the form bean getter/setter declaration. Also, this
> isn't causing your
> problem, but you assign your form to header1Form_
> but then continue to
> use a cast with the original form when you could
> just use the
> header1form_ instance variable without a cast.
> 
> Also, a style point, by convention the names of
> classes are capitalized in Java.
> 
> -ed
> 
> On 7/27/05, Chris Pat <[EMAIL PROTECTED]> wrote:
> > Hello
> > I have been trying for too long to get this simply
> to
> > work.  Below is very simple code that fails at the
> > first attempt to retrieve the form bean method. 
> What
> > can possibly be wrong, it gives compiles, gives a
> NPE.
> >  The form bean variables are ="" in the reset
> method.
> > I do know how to do it as the example further
> below
> > works fine.  Please advise.
> > 
> > public class search1Action extends Action {
> > public ActionForward execute(ActionMapping
> > actionMapping,
> >  ActionForm form,
> > 
> HttpServletRequest
> > request,
> > 
> HttpServletResponse
> > response) {
> > header1Form header1Form_ = (header1Form)
> form;
> > String queryString =
> > ((header1Form)form).getQuery();
> > String animalType =
> > ((header1Form)form).getAnimalType();
> > 
> > This works fine:
> > public class min01Action extends Action {
> > public ActionForward execute(ActionMapping
> > actionMapping,
> >  ActionForm form,
> > 
> HttpServletRequest
> > request,
> > 
> HttpServletResponse
> > response) {
> > 
> > min01Form min01Form_ = (min01Form)form;
> > String fromAction =
> > ((min01Form)form).getSample().toUpperCase();
> > String fromAction2 =
> > ((min01Form)form).getSample2().toUpperCase();
> > HttpSession session =
> request.getSession();
> >
> session.setAttribute("fromAction",fromAction);
> > 
> > session.setAttribute("fromAction2",fromAction2);
> > return
> (actionMapping.findForward("success"));
> > }
> > }
> > 
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.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]
> 
> 





Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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



Re: newbie...but not stupid...so I thought

2005-07-27 Thread Chris Pat
Hi Dave
That is just a leftover.  The retrieved form value is
from the fast of the passed in form bean.

--- Dave Newton <[EMAIL PROTECTED]> wrote:

> Chris Pat wrote:
> 
> >header1Form header1Form_ = (header1Form)
> form;
> >String queryString =
> ((header1Form)form).getQuery();
> >String animalType =
> ((header1Form)form).getAnimalType();
> >  
> >
> Where is the NPE happening? Is form null? Is the NPE
> in the getters? 
> Kinda hard to say from this.
> 
> >min01Form min01Form_ = (min01Form)form;
> >String fromAction =
> ((min01Form)form).getSample().toUpperCase();
> >  
> >
> Why do you create a casted 'form' then recast 'form'
> each time you 
> retrieve a form value?
> 
> Dave
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


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

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



Re: newbie...but not stupid...so I thought

2005-07-27 Thread Ed Griebel
In search1Action, is the whole form null? Without seeing the relevant
parts of struts-config nor the form bean declaration, I can only
guess. There could be a typo in your struts-config for the action or
the form bean getter/setter declaration. Also, this isn't causing your
problem, but you assign your form to header1Form_ but then continue to
use a cast with the original form when you could just use the
header1form_ instance variable without a cast.

Also, a style point, by convention the names of classes are capitalized in Java.

-ed

On 7/27/05, Chris Pat <[EMAIL PROTECTED]> wrote:
> Hello
> I have been trying for too long to get this simply to
> work.  Below is very simple code that fails at the
> first attempt to retrieve the form bean method.  What
> can possibly be wrong, it gives compiles, gives a NPE.
>  The form bean variables are ="" in the reset method.
> I do know how to do it as the example further below
> works fine.  Please advise.
> 
> public class search1Action extends Action {
> public ActionForward execute(ActionMapping
> actionMapping,
>  ActionForm form,
>  HttpServletRequest
> request,
>  HttpServletResponse
> response) {
> header1Form header1Form_ = (header1Form) form;
> String queryString =
> ((header1Form)form).getQuery();
> String animalType =
> ((header1Form)form).getAnimalType();
> 
> This works fine:
> public class min01Action extends Action {
> public ActionForward execute(ActionMapping
> actionMapping,
>  ActionForm form,
>  HttpServletRequest
> request,
>  HttpServletResponse
> response) {
> 
> min01Form min01Form_ = (min01Form)form;
> String fromAction =
> ((min01Form)form).getSample().toUpperCase();
> String fromAction2 =
> ((min01Form)form).getSample2().toUpperCase();
> HttpSession session = request.getSession();
> session.setAttribute("fromAction",fromAction);
> 
> session.setAttribute("fromAction2",fromAction2);
> return (actionMapping.findForward("success"));
> }
> }
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: newbie...but not stupid...so I thought

2005-07-27 Thread Dave Newton

Chris Pat wrote:


   header1Form header1Form_ = (header1Form) form;
   String queryString = ((header1Form)form).getQuery();
   String animalType = ((header1Form)form).getAnimalType();
 

Where is the NPE happening? Is form null? Is the NPE in the getters? 
Kinda hard to say from this.



   min01Form min01Form_ = (min01Form)form;
   String fromAction = ((min01Form)form).getSample().toUpperCase();
 

Why do you create a casted 'form' then recast 'form' each time you 
retrieve a form value?


Dave



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



newbie...but not stupid...so I thought

2005-07-27 Thread Chris Pat
Hello
I have been trying for too long to get this simply to
work.  Below is very simple code that fails at the
first attempt to retrieve the form bean method.  What
can possibly be wrong, it gives compiles, gives a NPE.
 The form bean variables are ="" in the reset method.
I do know how to do it as the example further below
works fine.  Please advise.

public class search1Action extends Action {
public ActionForward execute(ActionMapping
actionMapping,
 ActionForm form,
 HttpServletRequest
request,
 HttpServletResponse
response) {
header1Form header1Form_ = (header1Form) form;
String queryString =
((header1Form)form).getQuery();
String animalType =
((header1Form)form).getAnimalType();

This works fine:
public class min01Action extends Action {
public ActionForward execute(ActionMapping
actionMapping,
 ActionForm form,
 HttpServletRequest
request,
 HttpServletResponse
response) {

min01Form min01Form_ = (min01Form)form;
String fromAction =
((min01Form)form).getSample().toUpperCase();
String fromAction2 =
((min01Form)form).getSample2().toUpperCase();
HttpSession session = request.getSession();
session.setAttribute("fromAction",fromAction);
   
session.setAttribute("fromAction2",fromAction2);
return (actionMapping.findForward("success"));
}
}

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

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



Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread John Henry Xu
+1 on Yan Hu, Tamas and Pedro

If one open a web hosting business, what should J2EE hosting (including
EJB, struts, JSP, servlets, MySQL, PostgreSQL, web services on JBoss)
charge per month that you are willing to pay? What is the market price
for such hosting now?   It seems there is a market there I can explore.

Regards,

John H. Xu

http://www.usanalyst.com
http://www.GetusJobs.com (The largest free job portal in North America)

  - Original Message -
  From: "Pedro Salgado"
  To: "Struts Users Mailing List"
  Subject: Re: JSF is the beginning of the end of Struts !!!
  Date: Wed, 27 Jul 2005 17:47:20 +0200

  >
  > +1 for that answer.
  >
  > Pedro Salgado
  >
  > On 27/07/2005 08:15, "Tamas Szabo" wrote:
  >
  > > I wouldn't bet on PHP being more popular than Java webapps.
  > >
  > > I think that there will be more smaller Java webapps if there
  were much
  > > support for them at web hosting companies.
  > > I know several cases when Java webapp programmers, had to use PHP
  to
  > > make some smaller webapps for someone because most web hosting
  companies
  > > offer PHP support but they have no
  > > Java webcontainers installed.
  > >
  > > Tamas
  > >
  > >
  > >
  > > Yan Hu wrote:
  > >
  > >> Xu:
  > >> One of the reasons why you see a lot of PHP apps is that there
  are always a
  > >> lot more small apps
  > >> than large scale ones. I can not imagin you program a large
  scale site using
  > >> PHP. If you are an OO
  > >> guy, I could hardly imagin you even would like PHP(mixing all
  server side
  > >> code with html code).
  > >> There are a lot of java intranet applications you will never be
  able to
  > >> access. PHP has its niche
  > >> in the small app domain. It is fine. But it will never be at the
  same level
  > >> as Java. I do not
  > >> understand why you think PHP is more popular than Java. Let me
  ask you one
  > >> simple question. Why
  > >> are there so many more java jobs than PHP jobs? Anyone will tell
  you it is
  > >> because there is a lot
  > >> more demand for java. So you get the idea. With the advent of
  JSF, Java will
  > >> be even sexier. I
  > >> have long wished for something like asp.net code behind in C#.
  Now we have
  > >> JSF code behind in
  > >> Java. If asp.net can be a big success, why can't JSF?
  > >>
  > >>
  > >>
  > >>
  -
  > >> 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]






Jack H. Xu
Technology columnist and editor

http://www.usanalyst.com

http://www.getusjobs.com (The largest free job portal in North America)

-- 
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



RE: [OT] Force URLEncoder to use %20 instead of + for spaces

2005-07-27 Thread Neil Aggarwal
Laurie:

FYI, I got a response from someone on comp.lang.java.programmer.
They suggested using the java.net.URI class.
I tried it and it works perfectly.

Thanks,
Neil


--
Neil Aggarwal, JAMM Consulting, (214) 986-3533, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by
17% or more in 6 months or less! http://newsletter.JAMMConsulting.com

> -Original Message-
> From: Neil Aggarwal [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 26, 2005 9:38 PM
> To: 'Struts Users Mailing List'
> Subject: RE: [OT] Force URLEncoder to use %20 instead of + for spaces
> 
> 
> Laurie:
> 
> Did you try these two URLs I put in my email?
> 
> Why does this fail:
> http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping+G2
> +Driver.gif
> 
> and this one work:
> http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping%20
> G2%20Driver.gi
> f
> 
> Any ideas?
> 
> Thanks,
>   Neil
> 
> --
> Neil Aggarwal, JAMM Consulting, (214) 986-3533, www.JAMMConsulting.com
> FREE! Valuable info on how your business can reduce operating costs by
> 17% or more in 6 months or less! http://newsletter.JAMMConsulting.com
> 
> > -Original Message-
> > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
> > Sent: Tuesday, July 26, 2005 5:12 PM
> > To: user@struts.apache.org
> > Subject: Re: [OT] Force URLEncoder to use %20 instead of + 
> for spaces
> > 
> > 
> > Neil Aggarwal wrote:
> > > Hello:
> > > 
> > > When I encode the name of an image file to place into a 
> > URL, I use this
> > > code:
> > > 
> > > URLEncoder.encode(imageName,"UTF-8")
> > > 
> > > This gives me image names with spaces replaced by + signs 
> > which IE does not
> > > like. 
> > > 
> > > If I change the spaces to %20, the URL works perfectly in IE.
> > > 
> > > For example, if my image name is Ping G2 Driver.gif, 
> > URLEncoder gives me
> > > this URL:
> > >  
> >  > 2+Driver.gif>
> > > 
> > http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping+G2
> +Driver.gif
> > 
> > If I try to load this URL in IE, it gives me a 404 error.
> > 
> > If I use the exact same url with %20, it works just fine:
> >  
> >
>  0G2%20Driver.g
> > if>
> >
> http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping%20
> G2%20Driver.gi
> > f
> > 
> > I thought + and %20 were both acceptable for spaces in a URL, but
> apparently
> > IE does not like the plus signs.  
> >  
> > Is there a way to force URLEncoder to use %20 instead of + signs?
> 
> Nope. '+' is canonical and should work fine. What encoding 
> are you sending 
> your pages with? That's the only thing I can think of that 
> might make a 
> difference.
> 
> L.
> -- 
> Laurie, Open Source advocate, Java geek and novice blogger:
> http://www.holoweb.net/laurie
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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



Re: probably a cleaner way... testing for just one user

2005-07-27 Thread John Henry Xu
David,

I think I asked Tamas a question in my previous email. This applies to
you too. The goal was protecting data or other resource to one user. If
you guys really think after connection is disconnected, sessions still
alive, you will find the situation nobody could connect to the server
as in my quotes. And it looks not good.

I agree with you this needs not continue due to the fact that Rick made
his mind on his implementation and it seems we focus on different places,
mine on one user uses data alone to ensure data integrity and yours on
absolutely one session. As for rick's application, his implementation is
fine and he may change different pages depends on how many pages in that
application.

John H. Xu

  - Original Message -
  From: "John Henry Xu"
  To: "Struts Users Mailing List"
  Subject: Re: probably a cleaner way... testing for just one user
  Date: Wed, 27 Jul 2005 09:26:00 -0500

  >
  > Hi Tamas,
  >
  > I quote the complete requirement. The objective of one user is
  because of
  > data need be accessed by only one user.
  >
  > > > >>Rick's requirement: I have an odd requirement where this
  internal
  > > application should
  > > > >> only be used by one valid user(one session) at a time. (The
  data
  > > > >> being worked with in the application would require so many
  locks
  > > > >> that's it just easier to restrict it to one user).
  >
  > Do you say that the first person who dropped connection still doing
  data
  > access on data sources (and two person using data the same time)?
  Rick's
  > original objective was trying to limit one person use data sources.
  >
  > According to you, user Adam completed his work and dropped the
  connection
  > and session still alive. Other users Charles, Beth still cannot
  connect
  > and cannot do work by using the server. I think this is not good.
  >
  > The reason one may want one user at one time is to protect
  resources such
  > as data not used by 2 people.
  >
  > John H. Xu
  > http://www.usanalyst.com
  > http://www.GetusJobs.com (The largest free job portal in North
  America)
  >
  > - Original Message -
  > From: "John Henry Xu"
  > To: "Struts Users Mailing List"
  > Subject: Re: probably a cleaner way... testing for just one user
  > Date: Wed, 27 Jul 2005 07:41:10 -0500
  >
  > >
  > > Tamas,
  > >
  > > Do you say that the first person who dropped connection still
  doing
  > data
  > > access on data sources (and two person using data the same time)?
  > Rick's
  > > original objective was trying to limit one person use data
  sources.
  > >
  > > > >>Rick's requirement: I have an odd requirement where this
  > internal
  > > application should
  > > > >> only be used by one valid user(one session) at a time. (The
  > data
  > > > >> being worked with in the application would require so many
  > locks
  > > > >> that's it just easier to restrict it to one user).
  > > > >>
  > >
  > > John H. Xu
  > >
  > > - Original Message -
  > > From: "Tamas Szabo"
  > > To: "Struts Users Mailing List"
  > > Subject: Re: probably a cleaner way... testing for just one user
  > > Date: Wed, 27 Jul 2005 14:08:36 +0800
  > >
  > > >
  > > > John Henry Xu wrote:
  > > >
  > > > > Here is Rick's original requirement,
  > > > >
  > > > >
  > > > >
  > > > >> I have an odd requirement where this internal application
  > should
  > > > >> only be used by one valid user(one session) at a time. (The
  > data
  > > > >> being worked with in the application would require so many
  > locks
  > > > >> that's it just easier to restrict it to one user).
  > > > >>
  > > > >>
  > > > >
  > > > > Only if one session ends, another connection can establish
  > > connections,
  > > > > always you have only one user connect to data. It doen't
  matter
  > > if
  > > > > web-browser performing keep-alive or not. If web browser
  droped
  > > the
  > > > > connection, this session ends and original user drops
  > connection.
  > > > I'm not sure that I got this right:
  > > >
  > > > "If web browser droped the
  > > > connection, this session ends and original user drops
  > connection."
  > > >
  > > > The session doesn't end when the browser closes a connection.
  > > >
  > > > If you limit the HTTP connections thath can be made to an
  > > > application to 1, it will not
  > > > assure you that you will have only 1 session at a time.
  > > >
  > > > If the browser closes a HTTP connection to the web server the
  > > > session of the user will still
  > > > be alive on the server. And if a second user opens a connection
  > in
  > > > this time he will be able
  > > > to open a second connection and so on...
  > > >
  > > > Furthermore a browser can make more connections to a web server
  > to
  > > > load data(for example
  > > > it loads images found in a HTML using separete connections).
  > > > You would block all this 'extra' connections if you used your
  > > approach.
  > > >
  > > >
  > > > > >David said: it sounds like you

Re: How to have logical 'OR' between two validator rules ?

2005-07-27 Thread Glen Mazza
Yes, much clearer now.  If you're using Struts 1.2.x, There is a 
"validwhen" clause that may help you--look at the test example just 
below it:


http://struts.apache.org/userGuide/dev_validator.html#validwhen

Glen


Marc Demlenne escribió:
Yes, sorry I made a mistake while explaining. I'll try to do it better now. 


Of course I need always to validate my form, you're right, sorry for
the confusion. But I need the form "to be valid" if either it is
validated threw the mask validator, OR if it is unchanged, even if in
this case it does not look like the mask wants any more.

So I want a my field to be something like "^[0-9]{4}$". Ok, I use the
mask validator, and everything is fine.

Now, if the value already stored in the DB isn't like this mask (there
are some good reasons to allow this), I want the user to be able to
modify everything in his form. If he doesn't change the value of this
field, everything should be correct. BUT if he decide to modify this
field, then he MUST enter a mask-valid field.

To cope with this, I can use another field, the same, but hidden,
containing the original value, for example.  Then in my validation, I
would like,
- First to check if the given field is the same as the hidden one. In
this case it has not been modified, and I say validation returns true.
- Then, if those 2 fields are not the same, I check the real field
(the one enterered by user) against the mask threw the mask validator,
and I only accept all of this if this last validation returns true.

Hope it's better explained ? 


Thanks Joe for this wonderful link. I have not yet verified
everything, but I'm affraid it won't be satisfying in my case ... I'm
still investigating ...



On 27/07/05, Glen Mazza <[EMAIL PROTECTED]> wrote:


Marc Demlenne wrote:



Hi and thanks for the answer,

In fact my problem could be explained the following way :

Having two fields A and B, I need to validate A if
(A == mask) OR (A == B)


Your way of stating the problem doesn't seem right and may be adding to
the difficulties here--I would again think that you *always* need to
validate A, it's just that validation passes 100% if the above two
conditions fit, but passes/fails (depending on the results of more
complex logic) if the above isn't correct.

I.e., instead of saying, "If a ZIP code is provided, I need to validate
that it is five digits long", why not:  "I need to validate that the ZIP
code is either empty, or if not 5 digits"?

Again, I'm unsure here (sorry, still a newbie), but using the p. 38
example below, my inclination is that you can always validate but just
change the validation logic if the scenario above occurs, something like:

(Pseudocode):

validate() {
   if (A.equals(mask) || a.equals(B)) {
  return null; // validate always "true"
   } else {
  // do actual validation,
  // return ActionErrors or "null" as appropriate
   }
}

I hope someone else can provide a better answer for you though--as I'm
also quite curious here.

Glen




I don't know if it is possible to include a field in a mask
expression. But in the other case, I need to have an alternative
between the two validators. Is thos possible with struts validator ?

If this isn't possible, I'll need to create my own validator plugin

But if someone has eny advice, it's welcomed !


On 26/07/05, Glen Mazza <[EMAIL PROTECTED]> wrote:



I'm not exactly certain of your needs, but I think you can always
activate validation but just change the validation code based on the
value/state of other fields (such as the "original" one you mention).

Perhaps the Java code example on page 38 of
http://www.objectsource.com/Struts_Survival_Guide.pdf can be of help for
you--I am unsure.

Glen








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



Re: How to have logical 'OR' between two validator rules ?

2005-07-27 Thread Marc Demlenne
Yes, sorry I made a mistake while explaining. I'll try to do it better now. 

Of course I need always to validate my form, you're right, sorry for
the confusion. But I need the form "to be valid" if either it is
validated threw the mask validator, OR if it is unchanged, even if in
this case it does not look like the mask wants any more.

So I want a my field to be something like "^[0-9]{4}$". Ok, I use the
mask validator, and everything is fine.

Now, if the value already stored in the DB isn't like this mask (there
are some good reasons to allow this), I want the user to be able to
modify everything in his form. If he doesn't change the value of this
field, everything should be correct. BUT if he decide to modify this
field, then he MUST enter a mask-valid field.

To cope with this, I can use another field, the same, but hidden,
containing the original value, for example.  Then in my validation, I
would like,
- First to check if the given field is the same as the hidden one. In
this case it has not been modified, and I say validation returns true.
- Then, if those 2 fields are not the same, I check the real field
(the one enterered by user) against the mask threw the mask validator,
and I only accept all of this if this last validation returns true.

Hope it's better explained ? 

Thanks Joe for this wonderful link. I have not yet verified
everything, but I'm affraid it won't be satisfying in my case ... I'm
still investigating ...



On 27/07/05, Glen Mazza <[EMAIL PROTECTED]> wrote:
> Marc Demlenne wrote:
> 
> > Hi and thanks for the answer,
> >
> > In fact my problem could be explained the following way :
> >
> > Having two fields A and B, I need to validate A if
> > (A == mask) OR (A == B)
> 
> Your way of stating the problem doesn't seem right and may be adding to
> the difficulties here--I would again think that you *always* need to
> validate A, it's just that validation passes 100% if the above two
> conditions fit, but passes/fails (depending on the results of more
> complex logic) if the above isn't correct.
> 
> I.e., instead of saying, "If a ZIP code is provided, I need to validate
> that it is five digits long", why not:  "I need to validate that the ZIP
> code is either empty, or if not 5 digits"?
> 
> Again, I'm unsure here (sorry, still a newbie), but using the p. 38
> example below, my inclination is that you can always validate but just
> change the validation logic if the scenario above occurs, something like:
> 
> (Pseudocode):
> 
> validate() {
> if (A.equals(mask) || a.equals(B)) {
>return null; // validate always "true"
> } else {
>// do actual validation,
>// return ActionErrors or "null" as appropriate
> }
> }
> 
> I hope someone else can provide a better answer for you though--as I'm
> also quite curious here.
> 
> Glen
> 
> 
> >
> > I don't know if it is possible to include a field in a mask
> > expression. But in the other case, I need to have an alternative
> > between the two validators. Is thos possible with struts validator ?
> >
> > If this isn't possible, I'll need to create my own validator plugin
> >
> > But if someone has eny advice, it's welcomed !
> >
> >
> > On 26/07/05, Glen Mazza <[EMAIL PROTECTED]> wrote:
> >
> >>I'm not exactly certain of your needs, but I think you can always
> >>activate validation but just change the validation code based on the
> >>value/state of other fields (such as the "original" one you mention).
> >>
> >>Perhaps the Java code example on page 38 of
> >>http://www.objectsource.com/Struts_Survival_Guide.pdf can be of help for
> >>you--I am unsure.
> >>
> >>Glen
> >>
> 


-- 
Marc Demlenne

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



Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Pedro Salgado
+1 for that answer.

Pedro Salgado

On 27/07/2005 08:15, "Tamas Szabo" <[EMAIL PROTECTED]> wrote:

> I wouldn't bet on PHP being more popular than Java webapps.
> 
> I think that there will be more smaller Java webapps if there were much
> support for them at web hosting companies.
> I know several cases when Java webapp programmers, had to use PHP to
> make some smaller webapps for someone because most web hosting companies
> offer PHP support but they have no
> Java webcontainers installed.
> 
> Tamas
> 
> 
> 
> Yan Hu wrote:
> 
>> Xu:
>> One of the reasons why you see a lot of PHP apps is that there are always a
>> lot more small apps
>> than large scale ones. I can not imagin you program a large scale site using
>> PHP. If you are an OO
>> guy, I could hardly imagin you even would like PHP(mixing all server side
>> code with html code).
>> There are a lot of java intranet applications you will never be able to
>> access. PHP has its niche
>> in the small app domain. It is fine. But it will never be at the same level
>> as Java. I do not
>> understand why you think PHP is more popular than Java. Let me ask you one
>> simple question. Why
>> are there so many more java jobs than PHP jobs? Anyone will tell you it is
>> because there is a lot
>> more demand for java. So you get the idea. With the advent of JSF, Java will
>> be even sexier. I
>> have long wished for something like asp.net code behind in C#. Now we have
>> JSF code behind in
>> Java. If asp.net can be a big success, why can't JSF?
>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>>  
>> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



RE: probably a cleaner way... testing for just one user

2005-07-27 Thread David G. Friedman
John,

Well, I see our discussion varies on one key point: Rick specifically uses
the word "session" for his original requirement.  The ideas put forth by
Tamas and myself try to limit the creation of session ID's on the server.
What you seem to put forth is limiting the server to answering one web
request at a time.

So why are we so strongly arguing against you? Because HTTP is a stateless
protocol.  Sessions often last through multiple pages/click-throughs. So,
after user Joe connects, he gets a session ID and page then his browser
closes the connection. During the next 10 seconds where he is on his browser
typing his login information and clicking the "login" button, anyone else
can connect to the server to get a page based on your idea of a single
process on the web server --- HTTP does NOT hold the connection open for
him.  Technically an HTTP keep-alive (a part of the HTTP v1.1 protocol)
should hold the connection open but it is not a reliable theory/practice.

If you develop webapps, you will need to understand that difference between
a session and limiting the server to handling "NNN" requests at a time.
Otherwise, it could mean the difference between a relatively secure webapp
and a breach of privacy/proprietary information on your site(s) due to
incorrectly secured information.

Sadly, this argument is like beating a dead horse
(http://www.goenglish.com/BeatADeadHorse.asp) so
if you'd like to discuss this further, we should
probably take it offline (since we're started
writing the same arguments over and over).

Regards,
David


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



Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Dave Newton

John Henry Xu wrote:


Here is Rick's original requirement,
 


I have an odd requirement where this internal application should
only be used by one valid user(one session) at a time. (The data
being worked with in the application would require so many locks
that's it just easier to restrict it to one user).
   


Only if one session ends, another connection can establish connections,
always you have only one user connect to data. It doen't matter if
web-browser performing keep-alive or not. If web browser droped the
connection, this session ends and original user drops connection. Another
new (only one) session will begin. So still only one user connects. So
this answered your posts below:
 

I'm not sure that disallowing additional _connections_ is a good idea; I 
think you'd want to be able to display a page saying "Hey, I'm not 
available right now, please try later" or something. I'd think it would 
be important to allow multiple connections but still let only one user 
be "logged in" at a time.


Dave



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



RE: [shale] questions

2005-07-27 Thread Abdullah Jibaly
Thanks!

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 26, 2005 7:07 PM
To: Struts Users Mailing List
Subject: Re: [shale] questions


From: "Abdullah Jibaly" <[EMAIL PROTECTED]>

> I want to start learning about Shale and have a couple questions to start
> out with:
> 1- What is the difference between Shale and MyFaces?

MyFaces (http://myfaces.apache.org/) is an implementation of the JavaServer
Faces Specification (JSR 127).  Follow the links from the MyFaces site to
learn more.

Shale is a new framework, based on JSF, which you can read about here:
http://struts.apache.org/shale, and on the wiki
http://wiki.apache.org/struts/StrutsShale, which includes a link to the
original proposal.

> 2- Is there any shale-minimal application available?

There are nightly builds available, including the Use Cases Sample App,
which is here:
   http://cvs.apache.org/builds/struts/nightly/struts-shale/use-cases/

(Take the file dated 7/24 -- the build files are being worked on at the
moment and nightlies should be back soon.)

Unzip it and drop the struts-shale-usecases.war file into your servlet
container.  It requires a Servlet 2.4 container such as Tomcat 5.x.

Most of the Shale discussion is taking place on struts-dev.  (If you need to
subscribe: http://struts.apache.org/mail.html#Subscribing )

-- 
Wendy Smoak


-
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: probably a cleaner way... testing for just one user

2005-07-27 Thread John Henry Xu
Hi Tamas,

I quote the complete requirement. The objective of one user is because of
data need be accessed by only one user.

> > >>Rick's requirement: I have an odd requirement where this internal
> application should
> > >> only be used by one valid user(one session) at a time. (The data
> > >> being worked with in the application would require so many locks
> > >> that's it just easier to restrict it to one user).

Do you say that the first person who dropped connection still doing data
access on data sources (and two person using data the same time)? Rick's
original objective was trying to limit one person use data sources.

According to you, user Adam completed his work and dropped the connection
and session still alive. Other users Charles, Beth still cannot connect
and cannot do work by using the server. I think this is not good.

The reason one may want one user at one time is to protect resources such
as data not used by 2 people.  

John H. Xu
http://www.usanalyst.com
http://www.GetusJobs.com (The largest free job portal in North America)

  - Original Message -
  From: "John Henry Xu"
  To: "Struts Users Mailing List"
  Subject: Re: probably a cleaner way... testing for just one user
  Date: Wed, 27 Jul 2005 07:41:10 -0500

  >
  > Tamas,
  >
  > Do you say that the first person who dropped connection still doing
  data
  > access on data sources (and two person using data the same time)?
  Rick's
  > original objective was trying to limit one person use data sources.
  >
  > > >>Rick's requirement: I have an odd requirement where this
  internal
  > application should
  > > >> only be used by one valid user(one session) at a time. (The
  data
  > > >> being worked with in the application would require so many
  locks
  > > >> that's it just easier to restrict it to one user).
  > > >>
  >
  > John H. Xu
  >
  > - Original Message -
  > From: "Tamas Szabo"
  > To: "Struts Users Mailing List"
  > Subject: Re: probably a cleaner way... testing for just one user
  > Date: Wed, 27 Jul 2005 14:08:36 +0800
  >
  > >
  > > John Henry Xu wrote:
  > >
  > > > Here is Rick's original requirement,
  > > >
  > > >
  > > >
  > > >> I have an odd requirement where this internal application
  should
  > > >> only be used by one valid user(one session) at a time. (The
  data
  > > >> being worked with in the application would require so many
  locks
  > > >> that's it just easier to restrict it to one user).
  > > >>
  > > >>
  > > >
  > > > Only if one session ends, another connection can establish
  > connections,
  > > > always you have only one user connect to data. It doen't matter
  > if
  > > > web-browser performing keep-alive or not. If web browser droped
  > the
  > > > connection, this session ends and original user drops
  connection.
  > > I'm not sure that I got this right:
  > >
  > > "If web browser droped the
  > > connection, this session ends and original user drops
  connection."
  > >
  > > The session doesn't end when the browser closes a connection.
  > >
  > > If you limit the HTTP connections thath can be made to an
  > > application to 1, it will not
  > > assure you that you will have only 1 session at a time.
  > >
  > > If the browser closes a HTTP connection to the web server the
  > > session of the user will still
  > > be alive on the server. And if a second user opens a connection
  in
  > > this time he will be able
  > > to open a second connection and so on...
  > >
  > > Furthermore a browser can make more connections to a web server
  to
  > > load data(for example
  > > it loads images found in a HTML using separete connections).
  > > You would block all this 'extra' connections if you used your
  > approach.
  > >
  > >
  > > > >David said: it sounds like you understand the concept behind
  the
  > > >
  > > >
  > > >> "acceptCount" but are relying on the browser to perform a
  > keep-alive to
  > > >>
  > > >>
  > > > hold
  > > >
  > > >
  > > >> the connection open...If the keep-alive
  > > >> doesn't work for a given browser, then the HTTP request is
  over
  > in a
  > > >>
  > > >>
  > > > second
  > > >
  > > >
  > > >> and the next person can login to the site.
  > > >>
  > > >>
  > > >
  > > > Remember the first person does not connected when the second
  > > > connected--still one user using data only.
  > > >
  > > >
  > > The first person is not connected but it has a Session on the
  > server.
  > > The second user can connect so he gets another Session.
  > >
  > > The original requierment said:
  > >
  > > I have an odd requirement where this internal application should
  > > only be used by one valid user(one session) at a time.
  > >
  > >
  > > It says *one session* explicitly.
  > >
  > > Tamas
  > >
  > >
  > >
  > >
  >
  -
  > > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > > For additional commands, e-mail: [EMAIL PROTECTED]
  >
  >
  >
  >
  >
  >
  > Jack H. Xu
 

Re: How to have logical 'OR' between two validator rules ?

2005-07-27 Thread Joe Germuska
There are two validators which come with Struts: "requiredif" and 
"validwhen"; "validwhen" is considered the logical successor to 
"requiredif", although I have never really been comfortable using it.


One of my colleagues has submitted an enhancement request which uses 
the JEXL expression evaluator to support extremely rich conditional 
validation, and we're using it pretty successfully here.  The one 
limitation is that, because of how the  tag works, 
sometimes you end up with invalid javascript if you use client side 
validation with the JEXL validator.  (Note that the JEXL validator 
itself doesn't do any client-side validation.)


Anyway, there have been some concerns expressed about adding the 
dependencies required by the JEXL validator directly to the Struts 
core, and now that this other issue with client-side javascript has 
come up, I'm not going to rush to commit the changes -- but the 
patches are in Bugzilla, and anyone willing to spend an hour or less 
could augment their own Struts project with the code and use the JEXL 
validator.


See http://issues.apache.org/bugzilla/show_bug.cgi?id=34849 for my 
colleague's solution.  I just also came across 
http://issues.apache.org/bugzilla/show_bug.cgi?id=22743, an older 
solution from Rick Hightower which is equivalent in intent and which 
also provides code for an alternative solution.  The ticket for the 
dynamic JS bug is 
http://issues.apache.org/bugzilla/show_bug.cgi?id=35806


Hope this helps.

Joe


At 3:09 PM +0200 7/27/05, Marc Demlenne wrote:

Hi and thanks for the answer,

In fact my problem could be explained the following way :

Having two fields A and B, I need to validate A if
(A == mask) OR (A == B)

I don't know if it is possible to include a field in a mask
expression. But in the other case, I need to have an alternative
between the two validators. Is thos possible with struts validator ?

If this isn't possible, I'll need to create my own validator plugin

But if someone has eny advice, it's welcomed !


On 26/07/05, Glen Mazza <[EMAIL PROTECTED]> wrote:

 I'm not exactly certain of your needs, but I think you can always
 activate validation but just change the validation code based on the
 value/state of other fields (such as the "original" one you mention).

 Perhaps the Java code example on page 38 of
 http://www.objectsource.com/Struts_Survival_Guide.pdf can be of help for
 you--I am unsure.

 Glen


 Marc Demlenne wrote:
 > Hi,
 >
 > I need to use a text box that must correspond to a regular expression,
 > so it can be validated by the "mask" validator.
 >
 > However, if and only if this value remains unchanged by customer, it
 > has not to be validated and can stay as is, even if it doesn't
 > correspond to the mask. This could be easily done by checking the
 > value against another field containing the original one with
 > "validwhen" validator for instance.
 >
 > However, I need to have my field validated even if only one of those
 > validators are OK, not both ones.
 >
 > How can I make this using validator plugin ?
 >
 > Thanks very much for any answer.
 >

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





--
Marc Demlenne

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



Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Tamas Szabo

Hi,



Do you say that the first person who dropped connection still doing data
access on data sources (and two person using data the same time)? Rick's
original objective was trying to limit one person use data sources. 

 


I said that more than one session will be alive on a server.
Rick said that he wants only one session at a time.

I have an odd requirement where this internal application should only be used 
by one valid user
*(one session) at a time*.

Tamas


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



Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread John Henry Xu
  - Original Message -
  From: "Stéphane Zuckerman"
  To: "Struts Users Mailing List"
  Subject: Re: JSF is the beginning of the end of Struts !!!
  Date: Wed, 27 Jul 2005 11:26:04 +0200

  >
  > Craig McClanahan a écrit :
  > > Tell me again how you come to the conclusion that Java is not a
  > > popular platform for web app deployments? (To say nothing of the
  fact
  > > that Microsoft might dispute the "PHP is king" rubric as well
  :-).
  >
  > I think this is always the same old argument : what we see on the
  > web are "Web sites", while J2EE is often (mostly ?) used for "Web
  > applications", which don't have the same goals at all.
  >
  > -- Stéphane Zuckerman
  >
  >
  -
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]


+1.

I can find I said in my previous emails that "most public web sites,
including opensource sites, use PHP. PHP dominates on many web sites,
just do a google search.". But Where did I say Java is not popular in web
applications? Maybe someone can find my original posts about my declaring
"Java is not popular in web applications"?

Also it is interesting many mentioned "small sites in PHP"? Small by what
standard? development budget or actual users in a given time? Do we
consider opensource websites small/medium or large? This topics can
easily get emotional and better use facts.

John H. Xu

http://www.usanalyst.com
http://www.GetusJobs.com (The largest free job portal in North America)

-- 
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



Re: How to have logical 'OR' between two validator rules ?

2005-07-27 Thread Marc Demlenne
Hi and thanks for the answer, 

In fact my problem could be explained the following way : 

Having two fields A and B, I need to validate A if 
(A == mask) OR (A == B)

I don't know if it is possible to include a field in a mask
expression. But in the other case, I need to have an alternative
between the two validators. Is thos possible with struts validator ?

If this isn't possible, I'll need to create my own validator plugin

But if someone has eny advice, it's welcomed !


On 26/07/05, Glen Mazza <[EMAIL PROTECTED]> wrote:
> I'm not exactly certain of your needs, but I think you can always
> activate validation but just change the validation code based on the
> value/state of other fields (such as the "original" one you mention).
> 
> Perhaps the Java code example on page 38 of
> http://www.objectsource.com/Struts_Survival_Guide.pdf can be of help for
> you--I am unsure.
> 
> Glen
> 
> 
> Marc Demlenne wrote:
> > Hi,
> >
> > I need to use a text box that must correspond to a regular expression,
> > so it can be validated by the "mask" validator.
> >
> > However, if and only if this value remains unchanged by customer, it
> > has not to be validated and can stay as is, even if it doesn't
> > correspond to the mask. This could be easily done by checking the
> > value against another field containing the original one with
> > "validwhen" validator for instance.
> >
> > However, I need to have my field validated even if only one of those
> > validators are OK, not both ones.
> >
> > How can I make this using validator plugin ?
> >
> > Thanks very much for any answer.
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Marc Demlenne

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



[OT] Hosting (London)

2005-07-27 Thread Marsh-Bourdon, Christopher
I have several high-specced Linux (Redhat ES) servers doing very little and
currently not hosted anywhere.  They are Apache/Tomcat/JBoss configured and
I did use them to host my test Struts apps.  I was wondering if anyone
wanted to share the server(s)/costs and get them co-located?  Seems a waste
that they are collecting dust and not doing something useful.  The rough
price for a single server is £50, for the pair it is £65.
 
Contact me on christopher at marsh-bourdon.com (I have a spam filter).
 
If anyone know a service cheaper than this, again, please let me know.
 
Cheers
 
Christopher Marsh-Bourdon
www.marsh-bourdon.com
 



The information contained herein is confidential and is intended solely for the
addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient, please
contact the sender either via the company switchboard on +44 (0)20 7623 8000, or
via e-mail return. If you have received this e-mail in error or wish to read our
e-mail disclaimer statement and monitoring policy, please refer to 
http://www.drkw.com/disc/email/ or contact the sender. 3167




Re: DispathAction Chain

2005-07-27 Thread Ed Griebel
Hello Luis-

I would recommend to break out the logic in
WomenDispatchAction.findAll() into a "helper object" (or call it
business object, DAO, etc.), then call the method from both actions.
If you've played around with actions calling actions, you can see that
getting everything populated correctly for the call is a pain.

Good luck,
-ed

On 7/27/05, Luis Gervaso <[EMAIL PROTECTED]> wrote:
> I need to call a DispatchAction inside other action
> problem:
> 
> ¿How can i set the appropiate parameter inside the first action?
> 
> ex:
> 
> i am inside insert() of PeopleAction and i need to call findAll() of
> WomenDispatchAction
> 
> in other words: i need req.setParameter("method","findAll"); (but this
> method isn't available in servlet api)
> 
> regards
> 
> --
> Un saludo
> 
>

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



MessageResources available on plugin initialization time?

2005-07-27 Thread Borislav Sabev

Hi all
Does somebody know if it's possible to get MessageResources diring 
initialization of plugin?


I do some "global" initializations including reading some string from 
resource file, so I need this resource "as early as possible"


Or maybe "global initializations" should not be in plugin (in fact I 
wrote this plugin only for this purpose). Does some more elegant aprocah 
exist?


Regards
Borislav





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



Re: [Tiles] Sharing Context Between Two Tiles

2005-07-27 Thread Adam Hardy
Thanks for the explanation. I guess it's another technology I'll have to 
add to my list of 'to do's.


Re your issue - I see why you want to pass an 'attributes' generic 
object now. I thought it was way too non-specific and would lead you 
into a bit of a mess, but I guess if you are mimicing portlet behaviour, 
then it's what you need.



Adam

[EMAIL PROTECTED] on 27/07/05 13:26, wrote:
Portlets are java mini applications that work within the Java Portlet 
Specification. They are ment to run using a Portal Server like Websphere 
Portal server, Metadot, or jetspeed. These 'applications' can share 
variables, etc via the Portlet container. The container manages the 
placement and look and feel of the applications in a simular fashen to 
the tiles layout, but come with a overhead cost. (I would venture to say 
much larger than the tiles overhead).


Re: [Tiles] Sharing Context Between Two Tiles

Basically that is the way you do it, although I'm not really sure from
your description that I know why you thought you could achieve what it
looks like you were attempting.

A question for you that bugs me everytime I see 'portlet' come up: what
on earth are portlets? Are they meant to be a different technology to
'servlets'? Surely not, as you are using JSPs.


Adam


Ian Brandt on 26/07/05 18:17, wrote:
 > Hello All,
 >
 > I'm trying to write a portlet like component using tiles.  A simplified
 > version of my first attempt follows:
 >
 > The portlet definition:
 >
 >  path="/tiles/uicomponents/portlet.jsp">
 >
 > 

 > 
 >
 >
 > portlet.jsp:
 >
 > [...]
 >
 > 
 > 
 > 
 >
 >
 > The definition for a particular portlet:
 >
 >   extends=".uicomponents.portlet ">
 >
 > 
 > 
 > 
 >
 >
 > oneportlet.jsp:
 >
 > [...]
 >
 >  name="aParam" classname="com.mycompany.SomeClass"/>
 >
 > 
 >
 >
 > Finally a body page that inserts oneportlets:
 >
 > [...]
 >
 >  items="${requestScope.collectionOfSomeClasses}">
 >
 > 
 > 
 > 
 > 
 >
 >
 > Upon trying this I found that aParam is not available to oneportlet.jsp
 > (attribute not found error on tiles:useAttribute).  I did find that
 > aParam was available to portlet.jsp.  From this I realized that my
 > tiles:insert in portlet.jsp was creating a new tile context for
 > oneportlet.jsp, and the fact that my .portlets.oneportlet definition was
 > extending .uicomponents.portlet did not mean that their context would be
 > shared.
 >
 > The only solution I've been able to think of so far is to add a generic
 > "attributes" attribute to my base portlet definition, and just pass that
 > on the insert of the content defined by the extending definition:
 >
 > The new portlet definition:
 >
 >  path="/tiles/uicomponents/portlet.jsp">
 >
 > 
 >
 > 

 > 
 >
 >
 > The new portlet.jsp:
 >
 > [...]
 >
 > 
 > 
 > 
 > 
 > 
 > 
 >
 > My body page has to build up a collection of all the parameters that
 > oneportlet needs (either from the action or using scriptlets), and
 > oneportlet has to iterate through that collection pulling out the
 > parameters it needs.  It's hard read and maintain.
 >
 > So thanks for listening to this point, and now for my question: can
 > anyone think of a better approach?  My next attempts were going to be
 > seeing if a tiles controller for .uicomponents.portlet could copy it's
 > context to the inserted content, or trying a JSTL import instead of a
 > tiles insert and seeing if the portlet's tiles context would be
 > available to the imported page.  Is there an entirely different way to
 > look at this that I'm not thinking of?
 >


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



Re: probably a cleaner way... testing for just one user

2005-07-27 Thread John Henry Xu
Tamas,

Do you say that the first person who dropped connection still doing data
access on data sources (and two person using data the same time)? Rick's
original objective was trying to limit one person use data sources. 

> >>Rick's requirement: I have an odd requirement where this internal
application should
> >> only be used by one valid user(one session) at a time. (The data
> >> being worked with in the application would require so many locks
> >> that's it just easier to restrict it to one user).
> >>

John H. Xu

  - Original Message -
  From: "Tamas Szabo"
  To: "Struts Users Mailing List"
  Subject: Re: probably a cleaner way... testing for just one user
  Date: Wed, 27 Jul 2005 14:08:36 +0800

  >
  > John Henry Xu wrote:
  >
  > > Here is Rick's original requirement,
  > >
  > >
  > >
  > >> I have an odd requirement where this internal application should
  > >> only be used by one valid user(one session) at a time. (The data
  > >> being worked with in the application would require so many locks
  > >> that's it just easier to restrict it to one user).
  > >>
  > >>
  > >
  > > Only if one session ends, another connection can establish
  connections,
  > > always you have only one user connect to data. It doen't matter
  if
  > > web-browser performing keep-alive or not. If web browser droped
  the
  > > connection, this session ends and original user drops connection.
  > I'm not sure that I got this right:
  >
  > "If web browser droped the
  > connection, this session ends and original user drops connection."
  >
  > The session doesn't end when the browser closes a connection.
  >
  > If you limit the HTTP connections thath can be made to an
  > application to 1, it will not
  > assure you that you will have only 1 session at a time.
  >
  > If the browser closes a HTTP connection to the web server the
  > session of the user will still
  > be alive on the server. And if a second user opens a connection in
  > this time he will be able
  > to open a second connection and so on...
  >
  > Furthermore a browser can make more connections to a web server to
  > load data(for example
  > it loads images found in a HTML using separete connections).
  > You would block all this 'extra' connections if you used your
  approach.
  >
  >
  > > >David said: it sounds like you understand the concept behind the
  > >
  > >
  > >> "acceptCount" but are relying on the browser to perform a
  keep-alive to
  > >>
  > >>
  > > hold
  > >
  > >
  > >> the connection open...If the keep-alive
  > >> doesn't work for a given browser, then the HTTP request is over
  in a
  > >>
  > >>
  > > second
  > >
  > >
  > >> and the next person can login to the site.
  > >>
  > >>
  > >
  > > Remember the first person does not connected when the second
  > > connected--still one user using data only.
  > >
  > >
  > The first person is not connected but it has a Session on the
  server.
  > The second user can connect so he gets another Session.
  >
  > The original requierment said:
  >
  > I have an odd requirement where this internal application should
  > only be used by one valid user(one session) at a time.
  >
  >
  > It says *one session* explicitly.
  >
  > Tamas
  >
  >
  >
  >
  -
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]






Jack H. Xu
Technology columnist and editor

http://www.usanalyst.com

http://www.getusjobs.com (The largest free job portal in North America)

-- 
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Pedro Salgado

I don't agree on any comments about technology A going to destroy B, C or D.
It is not really the technology that will put an end to something is the
software development community and the customers that will say what they
prefer, want, can provide or have to use.
A real case: anyone remembers the BETA and VHS videos? BETA was better but
it was VHS which survived.

It is all like natural selection: only the stronger will survive. Use the
technology wisely and you will be strong, otherwise it will not do you
anything for you.





About the remark about putting Struts/iBatis out of the scope of PHP.

The only problem is that if you try to port something from one technology to
another you must, beforehand, understand which critical(s) problem(s) does
it solve and then implement it with the strengths of the new technology.
If you make a mapping between the codes then you will not really gaining
nothing by doing the port.

I made my own small php-struts like implementation and worked quite nice and
actually increase the quality, speed of my PHP applications plus my work
efficiency.
So I continued using and improving it.
I also made 1 class that helped me achieve something very similar to iBatis
with no complexity at all.



In conclusion, good ideas/implementations can and should be re-used but with
they must be thought on the correct context and implemented exploring the
strengths/advantages of the new language/technology and, sometimes, with a
lot of creativity.



Pedro Salgado

On 27/07/2005 13:07, "Daniel Perry" <[EMAIL PROTECTED]> wrote:

>>> 3.  PHP.  I've done some PHP over the last couple years.
>> 
>> PHP and Struts are not antithetical. There have been several ports of
>> Struts to PHP, as well as Struts-like frameworks, such as Maverick and
>> FuseBox.
>> 
>> I'm not working in PHP myself, but if I were, you can bet I'd be
>> porting both Struts and iBATIS.
>> 
>> What we call Struts is not about Java, it's about an architecture that
>> pushes logic away from server pages and into a control layer that we
>> can configure via XML.
>> 
>> -Ted.
> 
> That is all true, but you'll find most php sites dont use anything that
> complicated.  And if they did, hosting would be more expensive.  e.g. phpBB
> is banned from most cheap shared hosting - it puts too much strain on
> php/mysql in a high volume server.
> 
> Also, java has been engineered to push things into layers.  Php has not.

> Also, java is OO.  Php is not (or is, but badly!).  I wrote an OO system a
> few years back in php, and it was a nightmare.
> The most annoying thing is
> that assignment/method parameters clones objects - it doesn't reference it.
> You can get round that by adding & in the right places. Only one nice OO
> thing is the serialize funtion.
> 
> So i would say that things like iBatis and struts fit nicely into the java
> world.  Give php-struts to the average php developer (i know lots of them)
> and theyd smile, and politely tell you where you can stick it.
> 
> Daniel.
> 
> 
> -
> 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: [Tiles] Sharing Context Between Two Tiles

2005-07-27 Thread BHansard

Portlets are java mini applications that work within the Java Portlet Specification.  They are ment to run using a Portal Server like Websphere Portal server, Metadot, or jetspeed.  These 'applications' can share variables, etc via the Portlet container.  The container manages the placement and look and feel of the applications in a simular fashen to the tiles layout, but come with a overhead cost. (I would venture to say much larger than the tiles overhead).


Adam Hardy <[EMAIL PROTECTED]>








Adam Hardy <[EMAIL PROTECTED]> 
07/27/2005 05:38 AM

Please respond to
"Struts Users Mailing List" 








To
Struts Users Mailing List 


cc



Subject
Re: [Tiles] Sharing Context Between Two Tiles








Basically that is the way you do it, although I'm not really sure from 
your description that I know why you thought you could achieve what it 
looks like you were attempting.

A question for you that bugs me everytime I see 'portlet' come up: what 
on earth are portlets? Are they meant to be a different technology to 
'servlets'? Surely not, as you are using JSPs.


Adam


Ian Brandt on 26/07/05 18:17, wrote:
> Hello All,
> 
> I'm trying to write a portlet like component using tiles.  A simplified
> version of my first attempt follows:
> 
> The portlet definition:
> 
> 
>     path="/tiles/uicomponents/portlet.jsp">
>     
>     
> 
> 
> 
> portlet.jsp:
> 
> [...]
> 
> 
>     
> 
> 
> 
> The definition for a particular portlet:
> 
> 
>      extends=".uicomponents.portlet ">
>     
>      
>     
> 
> 
> 
> oneportlet.jsp:
> 
> [...]
> 
> 
>     name="aParam" classname="com.mycompany.SomeClass"/>
> 
> 
> 
> 
> Finally a body page that inserts oneportlets:
> 
> [...]
> 
> 
>     items="${requestScope.collectionOfSomeClasses}">
> 
>     
>         
>     
> 
> 
> 
> Upon trying this I found that aParam is not available to oneportlet.jsp
> (attribute not found error on tiles:useAttribute).  I did find that
> aParam was available to portlet.jsp.  From this I realized that my
> tiles:insert in portlet.jsp was creating a new tile context for
> oneportlet.jsp, and the fact that my .portlets.oneportlet definition was
> extending .uicomponents.portlet did not mean that their context would be
> shared.
> 
> The only solution I've been able to think of so far is to add a generic
> "attributes" attribute to my base portlet definition, and just pass that
> on the insert of the content defined by the extending definition:
> 
> The new portlet definition:
> 
> 
>     path="/tiles/uicomponents/portlet.jsp">
>     
>     
>     
>     
> 
> 
> 
> The new portlet.jsp:
> 
> [...]
> 
> 
>     
>     
>         
>     
> 
> 
> My body page has to build up a collection of all the parameters that
> oneportlet needs (either from the action or using scriptlets), and
> oneportlet has to iterate through that collection pulling out the
> parameters it needs.  It's hard read and maintain.
> 
> So thanks for listening to this point, and now for my question: can
> anyone think of a better approach?  My next attempts were going to be
> seeing if a tiles controller for .uicomponents.portlet could copy it's
> context to the inserted content, or trying a JSTL import instead of a
> tiles insert and seeing if the portlet's tiles context would be
> available to the imported page.  Is there an entirely different way to
> look at this that I'm not thinking of?
> 
> Thanks!
> 
> Ian
> 
> -
> 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: Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Pilgrim, Peter
And somtimes you will arrive mid-project not necessarily on a "greenfield"
landscape where the technology decisions have already been defined
for you. What can a developer do except fall in line with the 
Struts-has-been-chosen-decission? The best you can do within
companies (corporations) is to get the management to accept the
latest release version and not accept a stale version e.g Struts 1.1 or
even version 1.1.

I am afraid, Struts, is here to stay until we see some well-publicised
proofs of concepts out there in the internet and in the headline news
that JSF or whatever out there is better. In IMHO you are more likely
to see well crafted Tapestry applications out there right here, right now



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 27 July 2005 13:10
To: Struts Users Mailing List
Cc: Struts Users Mailing List
Subject: RE: Re: JSF is the beginning of the end of Struts !!!


I guess I am a little lost on this comment. There are hundreds / thousands of 
complex Java sites available on the internet. Examples include US Airways 
Reservation system, EBay, BlueCross BlueShield of South Carolina, CitiBank, etc.

All of these public sites support very large user bases.

"John Henry Xu" <[EMAIL PROTECTED]>


"John Henry Xu" <[EMAIL PROTECTED]> 
07/26/2005 06:15 PM Please respond to
"Struts Users Mailing List" 


To
"Struts Users Mailing List" 


cc



Subject
RE: Re: JSF is the beginning of the end of Struts !!!



Mark,

You are right. I worked on Java and hope Java success. That is the reason
my links are java-based. I just want see more sites written in Java. That
is why I think in Java world, we need more doers than talkers.
If more java programmers code complex sites, java could compete to PHP.
But now almost all public sites are dominated by PHP and others... Hope
other Java programmers provides Java links as well.

John H. Xu

http://www.usanalyst.com 

http://www.Getusobs.com (The largest free job portal in North America)  

 - Original Message -
 From: "Mark Benussi"
 To: "'Struts Users Mailing List'"
 Subject: RE: Re: JSF is the beginning of the end of Struts !!!
 Date: Tue, 26 Jul 2005 22:35:53 +0100

 >
 > It is interesting to see that the two sites on your footer are
 written using
 > JSP.
 >
 > -Original Message-
 > From: John Henry Xu [mailto:[EMAIL PROTECTED]
 > Sent: 26 July 2005 20:42
 > To: Struts Users Mailing List
 > Subject: RE: Re: JSF is the beginning of the end of Struts !!!
 >
 > It is interesting to see PHP that has simple programming models
 defeat
 > Java in real applications.
 >
 > This leads to a question: Do Java best programming models and
 frameworks
 > conter-productive for real applications and sites?
 >
 > The new frameworks, other than struts, I like Spring. I would not
 use
 > JSF unless JSF had some real applications (based on Sun's
 reputation on
 > their new technologies).
 >
 > John H. Xu
 >
 >
 > http://www.usanalyst.com
 >
 > http://www.GetusJobs.com (The largest free job portal in North
 America)
 >
 > - Original Message -
 > From: "Daniel Perry"
 > To: "Struts Users Mailing List"
 > Subject: RE: Re: JSF is the beginning of the end of Struts !!!
 > Date: Tue, 26 Jul 2005 09:45:53 +0100
 >
 > >
 > > PHP / (origional) JSP are the same stuff really. Scripted web
 page.
 > Main
 > > difference is php not OO (well, the api isnt), and php doesnt
 > require any
 > > declarations/typing - which makes it nicer for less able
 > programmers.
 > >
 > > But the big difference is server requirements. JSP uses a lot
 more
 > server
 > > resources. PHP can be made available on the cheapest mass virtual
 > hosting
 > > servers. JSP (let alone full java web apps) cant.
 > >
 > > Also, pretty much anyone with any programming skills can pick up
 > php in a
 > > couple of days. Same cant be said for e.g.
 Struts+Java+JSP+Servlet
 > etc.
 > >
 > > This is why i am forced to use php for most sites (ok, so i
 > normally pass it
 > > on to someone else here), and i tend to use struts for larger
 > sites/apps
 > > that are going to be hosted internally/on dedicated servers.
 > >
 > > Daniel.
 > >
 > > > -Original Message-
 > > > From: John Henry Xu [mailto:[EMAIL PROTECTED]
 > > > Sent: 26 July 2005 04:17
 > > > To: Struts Users Mailing List
 > > > Subject: Re: Re: JSF is the beginning of the end of Struts !!!
 > > >
 > > >
 > > > JSF has been there for a while. We have to see how it does in
 > > > real applications.
 > > >
 > > > EJB has been there for many years, but its complexity of
 > > > configuration (at least before mature tools were developed)
 kept
 > > > many J2EE projects expensive and over budgets (bad ROI
 examples).
 > > >
 > > > Thus we have so many frameworks in Java. Sun is to be blamed
 for
 > > > always providing UNPROVEN technologies for java. In many cases,
 > > > following sun too closely is not wise.
 > > >
 > > > PHP was great but I hope java can catch up in real application.
 > > >
 > > > J

RE: Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread BHansard

I guess I am a little lost on this comment.  There are hundreds / thousands of complex Java sites available on the internet. Examples include US Airways Reservation system, EBay, BlueCross BlueShield of South Carolina, CitiBank,  etc.

All of these public sites support very large user bases.

">"John Henry Xu" <[EMAIL PROTECTED]>








"John Henry Xu" <[EMAIL PROTECTED]> 
07/26/2005 06:15 PM

Please respond to
"Struts Users Mailing List" 








To
"Struts Users Mailing List" 


cc



Subject
RE: Re: JSF is the beginning of the end of Struts !!!








Mark,

You are right. I worked on Java and hope Java success. That is the reason
my links are java-based. I just want see more sites written in Java. That
is why I think in Java world, we need more doers than talkers.
If more java programmers code complex sites, java could compete to PHP.
But now almost all public sites are dominated by PHP and others... Hope
other Java programmers provides Java links as well.

John H. Xu

http://www.usanalyst.com 

http://www.Getusobs.com (The largest free job portal in North America)  

  - Original Message -
  From: "Mark Benussi"
  To: "'Struts Users Mailing List'"
  Subject: RE: Re: JSF is the beginning of the end of Struts !!!
  Date: Tue, 26 Jul 2005 22:35:53 +0100

  >
  > It is interesting to see that the two sites on your footer are
  written using
  > JSP.
  >
  > -Original Message-
  > From: John Henry Xu [mailto:[EMAIL PROTECTED]]
  > Sent: 26 July 2005 20:42
  > To: Struts Users Mailing List
  > Subject: RE: Re: JSF is the beginning of the end of Struts !!!
  >
  > It is interesting to see PHP that has simple programming models
  defeat
  > Java in real applications.
  >
  > This leads to a question: Do Java best programming models and
  frameworks
  > conter-productive for real applications and sites?
  >
  > The new frameworks, other than struts, I like Spring. I would not
  use
  > JSF unless JSF had some real applications (based on Sun's
  reputation on
  > their new technologies).
  >
  > John H. Xu
  >
  >
  > http://www.usanalyst.com
  >
  > http://www.GetusJobs.com (The largest free job portal in North
  America)
  >
  > - Original Message -
  > From: "Daniel Perry"
  > To: "Struts Users Mailing List"
  > Subject: RE: Re: JSF is the beginning of the end of Struts !!!
  > Date: Tue, 26 Jul 2005 09:45:53 +0100
  >
  > >
  > > PHP / (origional) JSP are the same stuff really. Scripted web
  page.
  > Main
  > > difference is php not OO (well, the api isnt), and php doesnt
  > require any
  > > declarations/typing - which makes it nicer for less able
  > programmers.
  > >
  > > But the big difference is server requirements. JSP uses a lot
  more
  > server
  > > resources. PHP can be made available on the cheapest mass virtual
  > hosting
  > > servers. JSP (let alone full java web apps) cant.
  > >
  > > Also, pretty much anyone with any programming skills can pick up
  > php in a
  > > couple of days. Same cant be said for e.g.
  Struts+Java+JSP+Servlet
  > etc.
  > >
  > > This is why i am forced to use php for most sites (ok, so i
  > normally pass it
  > > on to someone else here), and i tend to use struts for larger
  > sites/apps
  > > that are going to be hosted internally/on dedicated servers.
  > >
  > > Daniel.
  > >
  > > > -Original Message-
  > > > From: John Henry Xu [mailto:[EMAIL PROTECTED]]
  > > > Sent: 26 July 2005 04:17
  > > > To: Struts Users Mailing List
  > > > Subject: Re: Re: JSF is the beginning of the end of Struts !!!
  > > >
  > > >
  > > > JSF has been there for a while. We have to see how it does in
  > > > real applications.
  > > >
  > > > EJB has been there for many years, but its complexity of
  > > > configuration (at least before mature tools were developed)
  kept
  > > > many J2EE projects expensive and over budgets (bad ROI
  examples).
  > > >
  > > > Thus we have so many frameworks in Java. Sun is to be blamed
  for
  > > > always providing UNPROVEN technologies for java. In many cases,
  > > > following sun too closely is not wise.
  > > >
  > > > PHP was great but I hope java can catch up in real application.
  > > >
  > > > John H. Xu
  > > >
  > > >
  > > > http://www.usanalyst.com
  > > >
  > > > http://www.GetusJobs.com (The largest free job portal in North
  > America)
  > > >
  > > >
  > > >
  > > > - Original Message -
  > > > From: netsql
  > > > To: user@struts.apache.org
  > > > Subject: Re: JSF is the beginning of the end of Struts !!!
  > > > Date: Mon, 25 Jul 2005 20:13:05 -0500
  > > >
  > > > >
  > > > > John Public wrote:
  > > > > > After just finishing my JSF class, I can confidently
  > > > > > confirm that JSF will eventually lead to Struts
  > > > > > becoming OBSOLETE.
  > > > >
  > > > > :-) Enhydra and Torque would say that too circa 2001.
  > > > > Put up a site and lets see it.
  > > > >
  > > > > > Let's all get
  > > > > > behind JSF before MS takes over the web.
  > > > >
  > > > > Nothing

DispathAction Chain

2005-07-27 Thread Luis Gervaso
I need to call a DispatchAction inside other action
problem:

¿How can i set the appropiate parameter inside the first action?

ex:

i am inside insert() of PeopleAction and i need to call findAll() of 
WomenDispatchAction

in other words: i need req.setParameter("method","findAll"); (but this 
method isn't available in servlet api)

regards

-- 
Un saludo


RE: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Daniel Perry
> > 3.  PHP.  I've done some PHP over the last couple years.
>
> PHP and Struts are not antithetical. There have been several ports of
> Struts to PHP, as well as Struts-like frameworks, such as Maverick and
> FuseBox.
>
> I'm not working in PHP myself, but if I were, you can bet I'd be
> porting both Struts and iBATIS.
>
> What we call Struts is not about Java, it's about an architecture that
> pushes logic away from server pages and into a control layer that we
> can configure via XML.
>
> -Ted.

That is all true, but you'll find most php sites dont use anything that
complicated.  And if they did, hosting would be more expensive.  e.g. phpBB
is banned from most cheap shared hosting - it puts too much strain on
php/mysql in a high volume server.

Also, java has been engineered to push things into layers.  Php has not.
Also, java is OO.  Php is not (or is, but badly!).  I wrote an OO system a
few years back in php, and it was a nightmare.  The most annoying thing is
that assignment/method parameters clones objects - it doesn't reference it.
You can get round that by adding & in the right places. Only one nice OO
thing is the serialize funtion.

So i would say that things like iBatis and struts fit nicely into the java
world.  Give php-struts to the average php developer (i know lots of them)
and theyd smile, and politely tell you where you can stick it.

Daniel.


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



RE: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Daniel Perry
This was the point i was making early on.

PHP is cheaper than java - in almost all ways.

Hosting: You can host php sites for a couple of pounds a month. Can you do
that with java?

Development: it's much easier to learn to make a PHP+Mysql databased web
site. Therefore programmers are cheaper.  Projects are cheaper. Therefore
more web design companies use php rather than java.

Servers: php has minimal overheads. It doesnt use a lot of memory, and it's
pretty efficient at executing pages (in mod_php mode rather than cgi).  It's
probably not as good as already-compiled jsps, but similar.  Java has huge
memory overheads. e.g. on one of our servers, httpd (inc php) is using 10MB,
Tomcat is using 140MB.  Tomcat has 4 apps (all small), php 38.

Most of our php apps are hosted on one server.  Most of our java apps have a
server each, and are on various companies intranets.  But most of our java
apps are much larger than the php ones - and a lot more maintainable!

Dont get me wrong. I much prefer writing systems using Struts, and push for
it.  But, we wont be doing all our sites in java anytime soon, as it's
cheaper to make small datbased sites in php.

Daniel.

> -Original Message-
> From: Tamas Szabo [mailto:[EMAIL PROTECTED]
> Sent: 27 July 2005 07:16
> To: Struts Users Mailing List
> Subject: Re: JSF is the beginning of the end of Struts !!!
>
>
> I wouldn't bet on PHP being more popular than Java webapps.
>
> I think that there will be more smaller Java webapps if there were much
> support for them at web hosting companies.
> I know several cases when Java webapp programmers, had to use PHP to
> make some smaller webapps for someone because most web hosting companies
> offer PHP support but they have no
> Java webcontainers installed.
>
> Tamas
>
>
>
> Yan Hu wrote:
>
> >Xu:
> >One of the reasons why you see a lot of PHP apps is that there
> are always a lot more small apps
> >than large scale ones. I can not imagin you program a large
> scale site using PHP. If you are an OO
> >guy, I could hardly imagin you even would like PHP(mixing all
> server side code with html code).
> >There are a lot of java intranet applications you will never be
> able to access. PHP has its niche
> >in the small app domain. It is fine. But it will never be at the
> same level as Java. I do not
> >understand why you think PHP is more popular than Java. Let me
> ask you one simple question. Why
> >are there so many more java jobs than PHP jobs? Anyone will tell
> you it is because there is a lot
> >more demand for java. So you get the idea. With the advent of
> JSF, Java will be even sexier. I
> >have long wished for something like asp.net code behind in C#.
> Now we have JSF code behind in
> >Java. If asp.net can be a big success, why can't JSF?
> >
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Ted Husted
On 7/26/05, Greg Reddin <[EMAIL PROTECTED]> wrote:
> 1.  Struts will someday die.  If it doesn't, then we've seen the end of
> technology advancement.  

And, someday, web applications, as we know them, will also die.

As mentioned elsewhere, ASP.NET made ASP Classic "obsolete" five years
ago. But, even today, I'm talking with a team who is only now planning
to migrate an enterprise application from classic to .NET. But, even
then, the coding won't start before 2006. I'm sure they are not alone.

Like it or not, the same thing will happen with Struts Classic
applications, but we will see even longer migration periods, because
Struts applications tend to be easier to maintain.

> 3.  PHP.  I've done some PHP over the last couple years.  

PHP and Struts are not antithetical. There have been several ports of
Struts to PHP, as well as Struts-like frameworks, such as Maverick and
FuseBox.

I'm not working in PHP myself, but if I were, you can bet I'd be
porting both Struts and iBATIS.

What we call Struts is not about Java, it's about an architecture that
pushes logic away from server pages and into a control layer that we
can configure via XML.

-Ted.

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



Re: Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread Ted Husted
On 7/26/05, Daniel Perry <[EMAIL PROTECTED]> wrote:
> Can anyone recommend any good resources? Sure a google search provides tons
> of information... but which is any good?

Mastering JavaServer Faces is an excellent book for Struts developers
to read. The authors try to put JSF in context with both Struts and
Swing.  One of the authors, Bill Dudley, is a Apache MyFaces
committer.

* 
http://opensource.atlassian.com/confluence/oss/pages/viewpage.action?pageId=139

Books purchased through this link benefit the ASF. 

HTH,  Ted.

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



Re: JSF is the beginning of the end of Struts [NOT]

2005-07-27 Thread Ted Husted
On 7/26/05, Mark Benussi <[EMAIL PROTECTED]> wrote:
> If Struts 'dies' I will take it on personally and do whatever it needs that
> it seems to be lacking.

Feel free to step up any time,  Mark. We're always on the look out for
volunteers.

* http://struts.apache.org/faqs/helping.html

-Ted.

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



RE: TilesRequestProcessor is executed twice

2005-07-27 Thread Ronnie Arosa
Hi,

I supposed that my browser isn't submitting requests twice, because this
feature just only happens when I work with tiles. If my mappings use
forwards to jsp pages, everything works OK. 

I've been investigating a bit more and I've found the exact point when
everything happens: trying to forward to mapping forward (In
RequestProcessor.java line 1057 - rd.forward(request, response);)

This is a snapshot of the two stack traces.

The first execution is finishing and trying to forwarding:
Thread [http-80-Processor24] (Suspended)
TilesRequestProcessor(RequestProcessor).doForward(String,
HttpServletRequest, HttpServletResponse) line: 1057
TilesRequestProcessor.doForward(String, HttpServletRequest,
HttpServletResponse) line: 261
TilesRequestProcessor.processTilesDefinition(String, boolean,
HttpServletRequest, HttpServletResponse) line: 237
TilesRequestProcessor.processForwardConfig(HttpServletRequest,
HttpServletResponse, ForwardConfig) line: 300
TilesRequestProcessor(RequestProcessor).process(HttpServletRequest,
HttpServletResponse) line: 231
ActionServlet.process(HttpServletRequest, HttpServletResponse) line:
1164
ActionServlet.doPost(HttpServletRequest, HttpServletResponse) line:
415
ActionServlet(HttpServlet).service(HttpServletRequest,
HttpServletResponse) line: 709
ActionServlet(HttpServlet).service(ServletRequest, ServletResponse)
line: 802
ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) line: 252
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)
line: 173
StandardWrapperValve.invoke(Request, Response) line: 213
StandardContextValve.invoke(Request, Response) line: 178
StandardHostValve.invoke(Request, Response) line: 126
ErrorReportValve.invoke(Request, Response) line: 105
StandardEngineValve.invoke(Request, Response) line: 107
CoyoteAdapter.service(Request, Response) line: 148
Http11Processor.process(InputStream, OutputStream) line: 856

Http11Protocol$Http11ConnectionHandler.processConnection(TcpConnection,
Object[]) line: 744
PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line:
527
LeaderFollowerWorkerThread.runIt(Object[]) line: 80
ThreadPool$ControlRunnable.run() line: 684
ThreadWithAttributes(Thread).run() line: 595

And then a new Thread is created and my action is executed another time.

Thread [http-80-Processor22] (Suspended (breakpoint at line 122 in
PartesMedicosAction))
PartesMedicosAction.execute(ActionMapping, ActionForm,
HttpServletRequest, HttpServletResponse) line: 122

TilesRequestProcessor(RequestProcessor).processActionPerform(HttpServletRequ
est, HttpServletResponse, Action, ActionForm, ActionMapping) line: 421
TilesRequestProcessor(RequestProcessor).process(HttpServletRequest,
HttpServletResponse) line: 226
ActionServlet.process(HttpServletRequest, HttpServletResponse) line:
1164
ActionServlet.doGet(HttpServletRequest, HttpServletResponse) line:
397
ActionServlet(HttpServlet).service(HttpServletRequest,
HttpServletResponse) line: 689
ActionServlet(HttpServlet).service(ServletRequest, ServletResponse)
line: 802
ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) line: 252
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse)
line: 173
StandardWrapperValve.invoke(Request, Response) line: 213
StandardContextValve.invoke(Request, Response) line: 178
StandardHostValve.invoke(Request, Response) line: 126
ErrorReportValve.invoke(Request, Response) line: 105
StandardEngineValve.invoke(Request, Response) line: 107
CoyoteAdapter.service(Request, Response) line: 148
Http11Processor.process(InputStream, OutputStream) line: 856

Http11Protocol$Http11ConnectionHandler.processConnection(TcpConnection,
Object[]) line: 744
PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line:
527
LeaderFollowerWorkerThread.runIt(Object[]) line: 80
ThreadPool$ControlRunnable.run() line: 684
ThreadWithAttributes(Thread).run() line: 595

Cheers. Ronnie
-Mensaje original-
De: Ed Griebel [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 21 de julio de 2005 16:45
Para: Struts Users Mailing List
Asunto: Re: TilesRequestProcessor is executed twice

Ronnie-

I was looking at the stack dumps you provided and there are some
filters in there, possibly someone else has set them up. Regardless,
it doesn't look like that is causing your problem.
  ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) line: 252
   ApplicationFilterChain.doFilter(ServletRequest,
ServletResponse) line: 173

Also, in the two stack traces, there is a doPost the first time, and a
doPost the second time. I've looked in the Struts source for
ActionServlet and there's no co

Re: JSF is the beginning of the end of Struts !!!

2005-07-27 Thread M4RC0
I think so, each kind of project needs a type of solution, i developed
lot of simple web sites using ASP/PHP with content management and a
little bit of bussinnes logic, but by crossing the line to web
applications, those technologies turn useless, unsecure and hard to
maintain, reuse and scale.
I mean, technology used must always be related to project
requeriments, so we should point to choose the correct side of that
line to place our project (simple web site or web application).


2005/7/27, Stéphane Zuckerman <[EMAIL PROTECTED]>:
> Craig McClanahan a écrit :
> > Tell me again how you come to the conclusion that Java is not a
> > popular platform for web app deployments?  (To say nothing of the fact
> > that Microsoft might dispute the "PHP is king" rubric as well :-).
> 
> I think this is always the same old argument : what we see on the web
> are "Web sites", while J2EE is often (mostly ?) used for "Web
> applications", which don't have the same goals at all.
> 
> --
> Stéphane Zuckerman
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
M4RC0

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



Re: [Tiles] Sharing Context Between Two Tiles

2005-07-27 Thread Adam Hardy
Basically that is the way you do it, although I'm not really sure from 
your description that I know why you thought you could achieve what it 
looks like you were attempting.


A question for you that bugs me everytime I see 'portlet' come up: what 
on earth are portlets? Are they meant to be a different technology to 
'servlets'? Surely not, as you are using JSPs.



Adam


Ian Brandt on 26/07/05 18:17, wrote:

Hello All,

I'm trying to write a portlet like component using tiles.  A simplified
version of my first attempt follows:

The portlet definition:

path="/tiles/uicomponents/portlet.jsp">






portlet.jsp:

[...]






The definition for a particular portlet:

 extends=".uicomponents.portlet ">

 





oneportlet.jsp:

[...]

name="aParam" classname="com.mycompany.SomeClass"/>





Finally a body page that inserts oneportlets:

[...]

items="${requestScope.collectionOfSomeClasses}">








Upon trying this I found that aParam is not available to oneportlet.jsp
(attribute not found error on tiles:useAttribute).  I did find that
aParam was available to portlet.jsp.  From this I realized that my
tiles:insert in portlet.jsp was creating a new tile context for
oneportlet.jsp, and the fact that my .portlets.oneportlet definition was
extending .uicomponents.portlet did not mean that their context would be
shared.

The only solution I've been able to think of so far is to add a generic
"attributes" attribute to my base portlet definition, and just pass that
on the insert of the content defined by the extending definition:

The new portlet definition:

path="/tiles/uicomponents/portlet.jsp">








The new portlet.jsp:

[...]








My body page has to build up a collection of all the parameters that
oneportlet needs (either from the action or using scriptlets), and
oneportlet has to iterate through that collection pulling out the
parameters it needs.  It's hard read and maintain.

So thanks for listening to this point, and now for my question: can
anyone think of a better approach?  My next attempts were going to be
seeing if a tiles controller for .uicomponents.portlet could copy it's
context to the inserted content, or trying a JSTL import instead of a
tiles insert and seeing if the portlet's tiles context would be
available to the imported page.  Is there an entirely different way to
look at this that I'm not thinking of?

Thanks!

Ian

-
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 is the beginning of the end of Struts !!!

2005-07-27 Thread Stéphane Zuckerman

Craig McClanahan a écrit :

Tell me again how you come to the conclusion that Java is not a
popular platform for web app deployments?  (To say nothing of the fact
that Microsoft might dispute the "PHP is king" rubric as well :-).


I think this is always the same old argument : what we see on the web 
are "Web sites", while J2EE is often (mostly ?) used for "Web 
applications", which don't have the same goals at all.


--
Stéphane Zuckerman

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



Re: [shale] questions

2005-07-27 Thread Werner Punz

The myfaces wiki I meant


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



Re: [shale] questions

2005-07-27 Thread Werner Punz

May I drop the info on the wiki?

Werner



Wendy Smoak wrote:

From: "Abdullah Jibaly" <[EMAIL PROTECTED]>


I want to start learning about Shale and have a couple questions to start
out with:
1- What is the difference between Shale and MyFaces?



MyFaces (http://myfaces.apache.org/) is an implementation of the JavaServer
Faces Specification (JSR 127).  Follow the links from the MyFaces site to
learn more.

Shale is a new framework, based on JSF, which you can read about here:
http://struts.apache.org/shale, and on the wiki
http://wiki.apache.org/struts/StrutsShale, which includes a link to the
original proposal.



2- Is there any shale-minimal application available?



There are nightly builds available, including the Use Cases Sample App,
which is here:
   http://cvs.apache.org/builds/struts/nightly/struts-shale/use-cases/

(Take the file dated 7/24 -- the build files are being worked on at the
moment and nightlies should be back soon.)

Unzip it and drop the struts-shale-usecases.war file into your servlet
container.  It requires a Servlet 2.4 container such as Tomcat 5.x.

Most of the Shale discussion is taking place on struts-dev.  (If you need to
subscribe: http://struts.apache.org/mail.html#Subscribing )




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



RE: probably a cleaner way... testing for just one user

2005-07-27 Thread David G. Friedman
Thank you Tamas.

I had been having a difficult time try to express to Mr. Xu the position
that a session does not hold open a connection to the web server until that
session ends but that a session simply refers to a set of data stored on the
web server for a limited period of time between multiple click-through
activities by the end user.

Regards,
David


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