Re: Struts HTML taglib vs. Standard HTML tags

2009-12-06 Thread davargas123

I did check those to see if they had anything to do with it, but those aren't
the problem. I literally copied them straight from another page in the same
web app that I'm adding my page to. The page I'm doing is part of a larger
web app that already has a number of jsp pages which include struts tags and
work perfectly fine, but when I use the tags I totally lose all of the
rendering. It's very odd, and I don't understand how I'm running into this
problem based on what I've been reading about how to make your jsp pages and
use strugs tags.



Paul Benedict-2 wrote:
 
 Did you check your server logs? I bet the problem is the taglib uri.
 
 See the TLD URIs section:
 http://wiki.apache.org/struts/StrutsUpgradeNotes12to13
 
 Paul
 
 On 12/4/2009 1:41 PM, davargas123 wrote:

 When I change the standard HTML tags of my .jsp page into the Struts
 tags,
 the page loads up completely blank, aside from what is loaded by the
 tiles-def. What could be causing this? I'm thinking that's why my page
 doesn't submit data to the actionform, but I don't see why it wouldn't be
 rendering the struts tags at all. For instance, if I even add ONE struts
 tag
 in the middle of my working code that isn't the html:form tag, the entire
 jsp page will not be rendered at all. It's driving me nuts, I've been
 working on figuring this out for far too long and would greatly
 appreciate
 some input.


 ---JSP---
 %...@taglib uri=/taglib/struts-html prefix=html%
 %...@taglib uri=/taglib/struts-bean prefix=bean%
 %...@page
 import=com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction
 %
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Struts-HTML-taglib-vs.-Standard-HTML-tags-tp26636386p26663145.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions

2009-12-06 Thread irene zeller sancho
You can use google guice  (
http://www.tzavellas.com/techblog/2007/07/03/using-dependency-injection-in-struts2-for-stateless-ejbs-part-1/).
I use it and works fine!


2009/12/4 Haroon Rafique haroon.rafi...@utoronto.ca

 On Today at 11:58am, JC=James Cook james.c...@wecomm.com wrote:

 JC EJB's can only be injected into other EJB's or Servlets, a struts 2
 JC action is essentially a pojo not a servlet. So you would either have to
 JC do a lookup in the context, or if you are using Spring look at using a
 JC jndi lookup and inject that reference into your class.
 JC
 JC Cookie

 Celinio,

 You can also use a Servlet simply for the purpose of invoking EJBs (let's
 call it EJBInvokerServlet) and then use the @Resource notation to bring
 any local EJB into your Action. See:
 http://osdir.com/ml/user-struts.apache.org/2009-07/msg00842.html

 Hope that helps.

 JC
 JC -Original Message-
 JC From: Fernandes Celinio [mailto:cfernan...@sopragroup.com]
 JC Sent: 04 December 2009 11:37
 JC To: user@struts.apache.org
 JC Subject: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions
 JC
 JC Hi,
 JC I know that it is not possible to inject EJB in Struts 2 actions.
 JC The following annotation would not work :
 JC @EJB
 JC MyBeanLocal mybean;
 JC
 JC But how come ? Since a Struts action is a servlet and injection works
 in
 JC a servlet, injection should work.
 JC
 JC Thanks for enlightening me.
 JC
 JC
 JC -
 JC To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 JC For additional commands, e-mail: user-h...@struts.apache.org
 JC
 JC

 --
 Haroon Rafique
 haroon.rafi...@utoronto.ca


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




Ajax validation to open a conditional popup

2009-12-06 Thread Raj Malhotra
Hi
My current functionality is to send the form values as request parameteres
to server where it will be first validated using xml and then Action will
process the request to save the values in the database.
Now i want to add the 'download to excel' functionality.User can key in the
values in form and can click on this download button to get the data in
excel sheet.But now i  have to do same validation and saving in this case
also.
So i thought of using ajax to send the request as usual to the server and if
i recieve the error show it on the jsp else on successfully saving the form
values.open a window popup to download the excel sheet.
Is my approach correct.IF so please provide me some details or pointer so
that i can implement this.In case if there is better appraoch then this,i
will love to hear from you.
Thanks
Raj


Re: RequiredFieldValidator and error message from property file via key

2009-12-06 Thread nguyenlinh

Hello,
I have the same problem. So what kind of validator should I use if I have a
field of type int and I want to make sure the user typed a number?
Thanks,
Linh


Greg Lindholm-2 wrote:
 
 You may have a different problem then you think;
 
 The @RequiredFieldValidator does not make any sense on a int
 (primitive) field as an int cannot be null. The validation interceptor
 checks the values on the fields after params interceptor sets the
 fields. The RequiredFieldValidator checks if the field is null which
 will never be the case for a primitive field.
 
 

-- 
View this message in context: 
http://old.nabble.com/RequiredFieldValidator-and-error-message-from-property-file-via-key-tp26640581p26669216.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: RequiredFieldValidator and error message from property file via key

2009-12-06 Thread nguyenlinh

I found the @ConversionErrorFieldValidator and it works almost the way I
wanted.
Now I get my error message but I also get the default struts error message
which is: Invalid field value for field field-name.
Is there any simple way I can get rid of the default message from struts?
Thanks


nguyenlinh wrote:
 
 Hello,
 I have the same problem. So what kind of validator should I use if I have
 a field of type int and I want to make sure the user typed a number?
 Thanks,
 Linh
 
 
 Greg Lindholm-2 wrote:
 
 You may have a different problem then you think;
 
 The @RequiredFieldValidator does not make any sense on a int
 (primitive) field as an int cannot be null. The validation interceptor
 checks the values on the fields after params interceptor sets the
 fields. The RequiredFieldValidator checks if the field is null which
 will never be the case for a primitive field.
 
 
 
 

-- 
View this message in context: 
http://old.nabble.com/RequiredFieldValidator-and-error-message-from-property-file-via-key-tp26640581p26669331.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: RequiredFieldValidator and error message from property file via key

2009-12-06 Thread nguyenlinh

I found the solution now.
Just override invalid.fieldvalue.field-name in your properties file.
for example:

invalid.fieldvalue.aField=Ivalid value for aField.

Thanks a lot, your answer got me on the right track.


Greg Lindholm-2 wrote:
 
 You may have a different problem then you think;
 
 The @RequiredFieldValidator does not make any sense on a int
 (primitive) field as an int cannot be null. The validation interceptor
 checks the values on the fields after params interceptor sets the
 fields. The RequiredFieldValidator checks if the field is null which
 will never be the case for a primitive field.
 
 
 

-- 
View this message in context: 
http://old.nabble.com/RequiredFieldValidator-and-error-message-from-property-file-via-key-tp26640581p26669544.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts HTML taglib vs. Standard HTML tags

2009-12-06 Thread Dan Vargas
One of the most confusing things about it is that I can insert just one
html:text tag, for instance, into the fully functional(as far as being
rendered correctly) page, and then it just fails to render any of my jsp
page, not just the text area defined by the struts tag.

On Sun, Dec 6, 2009 at 3:54 AM, davargas123 davargas...@gmail.com wrote:


 I did check those to see if they had anything to do with it, but those
 aren't
 the problem. I literally copied them straight from another page in the same
 web app that I'm adding my page to. The page I'm doing is part of a larger
 web app that already has a number of jsp pages which include struts tags
 and
 work perfectly fine, but when I use the tags I totally lose all of the
 rendering. It's very odd, and I don't understand how I'm running into this
 problem based on what I've been reading about how to make your jsp pages
 and
 use strugs tags.



 Paul Benedict-2 wrote:
 
  Did you check your server logs? I bet the problem is the taglib uri.
 
  See the TLD URIs section:
  http://wiki.apache.org/struts/StrutsUpgradeNotes12to13
 
  Paul
 
  On 12/4/2009 1:41 PM, davargas123 wrote:
 
  When I change the standard HTML tags of my .jsp page into the Struts
  tags,
  the page loads up completely blank, aside from what is loaded by the
  tiles-def. What could be causing this? I'm thinking that's why my page
  doesn't submit data to the actionform, but I don't see why it wouldn't
 be
  rendering the struts tags at all. For instance, if I even add ONE struts
  tag
  in the middle of my working code that isn't the html:form tag, the
 entire
  jsp page will not be rendered at all. It's driving me nuts, I've been
  working on figuring this out for far too long and would greatly
  appreciate
  some input.
 
 
  ---JSP---
  %...@taglib uri=/taglib/struts-html prefix=html%
  %...@taglib uri=/taglib/struts-bean prefix=bean%
  %...@page
  import=com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction
  %
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Struts-HTML-taglib-vs.-Standard-HTML-tags-tp26636386p26663145.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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