RE: Can we specify variables in html form tags action attribute

2006-08-23 Thread Vidya Mahavadi
Exactly what you are trying to do.. 

-Original Message-
From: Chetan Pandey [mailto:[EMAIL PROTECTED] 
Sent: Wednesday 23 August 2006 06:22
To: 'Struts Users Mailing List'
Subject: Can we specify variables in html form tags action attribute

Dear All:

 

I am trying to put a variable in action attribute but it doesnt work.

 

 

<%String propertyaction = "/manageProperty?function=edit";

pageContext.setAttribute(propertyaction,"propertyaction");%>

 



 

 

Thanks.

 

Chetan

Discovery Holdings Limited

Registration number: 1999/007789/06

This message and any attachments are confidential and intended solely for the 
addressee. If you have received this message in error, please notify Discovery 
immediately, telephone number +27 11 529 2888. Any unauthorised use; alteration 
or dissemination of the contents of this email is strictly prohibited. In no 
event will Discovery or the sender be liable in any manner whatsoever to any 
person for any loss or any direct, indirect, special or consequential damages 
arising from use of this email or any linked website, including, without 
limitation, from any lost profits, business interruption, loss of programmes or 
other data that may be stored on any information handling system or otherwise 
from any assurance that this email is virus free even if Discovery is expressly 
advised of the possibility of such damages. Discovery is an Authorised 
Financial Services Provider. A full list of directors is available on our 
website at 
https://www.discovery.co.za/index_login.jhtml?p_content=/investor_relations/directorate.jhtml
 alternatively, to obtain a full list of Directors via email, please email 
[EMAIL PROTECTED]

 

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



Regarding Pager Taglib

2006-08-23 Thread Medicherla Lakshmi
Hi,
   
  Am using pager taglib in my jsps and its working fine with navigation.  
  But, suppose i enter to the 2nd page and edit a record in that page, 
  again the page is getting refreshed and the 2nd page status is not maintained.
  Can anyone please tell me how to check for the pagenumber or offset
  when the page is loaded.
   
  Thanks in Advance.
   


-
 Here's a new way to find what you're looking for - Yahoo! Answers 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 
NOW

TagExtraInfo ,getVariableInfo

2006-08-23 Thread Raghuveer
WHy exactly TagExtraInfo to be implemented.
What makes difference it this is used and not used in   in TLD
file


Example:
MessagesTei extends TagExtraInfo {

TagExtraInfo {

   public IterationTEI() {
  super();
   }

   public VariableInfo[] getVariableInfo(TagData data) {


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



get values from property file

2006-08-23 Thread Gomathi
hai i want to get  one value from property file  to action class how to achieve 
this

[OT] Re: get values from property file

2006-08-23 Thread Antonio Petrelli

Gomathi ha scritto:

hai i want to get  one value from property file  to action class how to achieve 
this
  


Uhm, I am starting to suspect that you want your homework done by the 
community...


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



[OT] Re: Regarding Pager Taglib

2006-08-23 Thread Antonio Petrelli

Medicherla Lakshmi ha scritto:

Hi,
   
  Am using pager taglib in my jsps and its working fine with navigation.  
  But, suppose i enter to the 2nd page and edit a record in that page, 
  again the page is getting refreshed and the 2nd page status is not maintained.

  Can anyone please tell me how to check for the pagenumber or offset
  when the page is loaded.
  


Err... What's the connection with Struts?


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



When my JSP calls the action class SErvlet Exception is thrown.

2006-08-23 Thread sheetal

Hi,
During deployment on tomcat,
when my jsp ties to invoke action class,
following error is flashed..

*type* Exception report

*message*

*description* _The server encountered an internal error () that 
prevented it from fulfilling this request._


*exception*

javax.servlet.ServletException: Servlet execution threw an exception

*root cause*

java.lang.NoClassDefFoundError
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
java.lang.Class.newInstance0(Class.java:350)
java.lang.Class.newInstance(Class.java:303)

org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:143)

org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:280)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:218)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

*note* _The full stack trace of the root cause is available in the 
Apache Tomcat/5.5.17 logs.

_

_Does anybody has any idea why is it so...(Why is the servlet exceotion 
thrown)

REgards,
Sheetal
_




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



[tiles] Tiles 2 and JSF

2006-08-23 Thread Mehdi Bahribayli
I want to be one on early users of Tiles 2. The followings are snippets of my 
configuration and code:
 pom.xml ---
...
org.apache.struts.tiles
tiles-core
2.0-SNAPSHOT
runtime

...
 web.xml ---
...


shale

org.apache.shale.faces.ShaleApplicationFilter





shale
/*
REQUEST
FORWARD

...


action
org.apache.tiles.servlets.TilesServlet

definitions-config
/WEB-INF/tiles-defs.xml


definitions-parser-validate
true

2

...
-
-- tiles-defs.xml --
http://struts.apache.org/dtds/tiles-config_1_1.dtd";>






-
-- /layouts/master.jsp -
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>
<%@ taglib uri="http://struts.apache.org/tags-tiles"; prefix="tiles" %>









 /subviews/header.jspf
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>


Header


---
 /subviews/footer.jspf
 <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>
 <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>
 
 
 Footer
 
 
 ---
--- /views/welcome.jsp --
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>
<%@ taglib uri="http://struts.apache.org/tags-tiles"; prefix="tiles" %>





--
I use Tomcat 5.x but when I deploy my app I get the following exception:
Aug 23, 2006 1:44:25 PM org.apache.tiles.taglib.InsertTag$InsertHandler doEndTag
SEVERE: Exception in '/layouts/master.jsp': Exception in JSP: 
/layouts/master.jsp:6

3: <%@ taglib uri="http://struts.apache.org/tags-tiles"; prefix="tiles" %>
4: 
5: 
6: 
7: 
8: 
9: 


Stacktrace:
org.apache.jasper.JasperException: Exception in JSP: /layouts/master.jsp:6

3: <%@ taglib uri="http://struts.apache.org/tags-tiles"; prefix="tiles" %>
4: 
5: 
6: 
7: 
8: 
9: 


Stacktrace:
at 
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at 
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
at 
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:614)
at org.apache.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:131)
at org.apache.tiles.TilesUtil.doInclude(TilesUtil.java:136)
at org.apache.tiles.taglib.InsertTag.doInclude(InsertTag.java:618)
at 
org.apache.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:748)
at org.apache.tiles.taglib.InsertTag.doEndTag(InsertTag.java:380)
at 
org.apache.jsp.views.welcome_jsp._jspx_meth_tiles_insert_0(welcome_jsp.java:125)
at org.apache.jsp.views.welcome_jsp._jspx_meth_f_view_0(welcome_jsp.java:94)
at org.apache.jsp.views.welcome_jsp._jspService(welcome_jsp.java:59)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

[OT] RE: TagExtraInfo ,getVariableInfo

2006-08-23 Thread Kalra, Ashwani

If you want to construct some object based on the attributes passed to
the tag and then make this object available on the jsp page in some
scope. JSP container uses this information. The object then is available
as java variable in the scriplet. 

Read this
http://java.sun.com/products/jsp/tutorial/TagLibraries13.html#62280

-Ashwani



-Original Message-
From: Raghuveer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 23, 2006 2:56 PM
To: user@struts.apache.org
Subject: TagExtraInfo ,getVariableInfo

WHy exactly TagExtraInfo to be implemented.
What makes difference it this is used and not used in   in TLD
file


Example:
MessagesTei extends TagExtraInfo {

TagExtraInfo {

   public IterationTEI() {
  super();
   }

   public VariableInfo[] getVariableInfo(TagData data) {


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


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



Getiing java.lang.IllegalArgumentException: No bean specified while using indexed properties in struts

2006-08-23 Thread krishan rathi
Hi all
   
  i am getting following exception  java.lang.IllegalArgumentException: No bean 
specified while using indexed properties in struts.
   
  MyForm Bean is 
  public class ReportItemForm extends ActionForm {
FormItem [] formItem=null;
  
   public void setItem(int index, FormItem formItem){
   this.formItem[index] = formItem;
  }
  public FormItem getItem(int index){
if(formItem==null ||(formItem.length)==0)
 return new FormItem();
return formItem[index];
  }
   
   
  }
   
   
  and  FormItem bean is specified like this 
  public class FormItem {
   String formitem;
  
   int order;
   
  public int getOrder() {
  return order;
  }
  /**
  * @param i
  */
  public void setOrder(int i) {
order = i;
  }
  /**
  * @return
  */
  public String getFormitem() {
return formitem;
  }
  /**
  * @param string
  */
  public void setFormitem(String string) {
   formitem = string;
  }
   
   
  i have set this array of  FormItem i.e formItem() properly and the data is 
dispalyed correctly on the page like this 
   
  
  
   
   
  but when i submitting this form i am getting following Exception
   
  java.lang.IllegalArgumentException: No bean specified 
   
  can anybody help me.
   
  any help will be greatly appriciated.
   
  thanks
   
  Krishan.
   


-
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail.

RE: request processor

2006-08-23 Thread Kalra, Ashwani

Do you know how to google ?

http://wiki.apache.org/struts/RequestProcessor 



-Original Message-
From: Gomathi [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 23, 2006 9:52 AM
To: Struts Users Mailing List
Subject: request processor

hai,
what is the use of request processor?

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



[OT][ANN] JAVAWUG BOF XX Videos Uploaded

2006-08-23 Thread Peter . Pilgrim
Hi

The JAVAWUG is happy to announce two new videos uploaded to Google Video
of the birds-of-a-feather meeting number 20. 

Petstore RIFE Edition by Emmanuel Okyere
http://video.google.com/videoplay?docid=37561501217859187&q=JAVAWUG+BOF+
XX

Rearchitecting Legacy J2EE Applications with the Spring Framework by
Peter Pilgrim
http://video.google.com/videoplay?docid=-4427639624207114903&q=JAVAWUG+B
OF+XX

Enjoy. Thanks

--
Peter Pilgrim
JUG Leader, Java Web User Group
http://jroller.com/page/javawug

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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



[OT] request.getServletPath() val not same in Filter & Servlet

2006-08-23 Thread pantichd

Hello,

Sorry for posting this in Struts mailing list but I can't seem to get an
answer on any other discussion groups. I've always had great results getting
good answers here so here goes...

I have a Filter in my app that uses the request.getServletPath() method to
get the name of the page being invoked without the context path.

This worked fine until I try to invoke a servlet. For example, if I invoke a
url like http://localhost/app1/servlet/package.ServletName the result of
calling request.getServletPath() is '/servlet'.

However, if I make the same call when I'm in the servlet the result is
'/servlet/package.ServletName'

Why does it give a different result in the filter and the servlet?

Thanks!

-- 
View this message in context: 
http://www.nabble.com/-OT--request.getServletPath%28%29-val-not-same-in-Filter---Servlet-tf2152125.html#a5943443
Sent from the Struts - User forum at Nabble.com.


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



RE: [OT] request.getServletPath() val not same in Filter & Servlet

2006-08-23 Thread David Friedman
Are you doing a "forward" or a "dispatch".   One of them handles mappings
differently because you are inside the application already and won't use the
filters a second time.   That is why the latest version of the servlet spec
allows you to specify which one in your web.xml mappings.

I'm heading outside so this quick question might get you pointed in the
right direction but you won't get an answer from me for another 8+ hours.
The tomcat site has docs on the servlet api if you need them so they might
shed some light on this behaviour as well.

Regards,
David

-Original Message-
From: pantichd [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 8:29 AM
To: user@struts.apache.org
Subject: [OT] request.getServletPath() val not same in Filter & Servlet



Hello,

Sorry for posting this in Struts mailing list but I can't seem to get an
answer on any other discussion groups. I've always had great results getting
good answers here so here goes...

I have a Filter in my app that uses the request.getServletPath() method to
get the name of the page being invoked without the context path.

This worked fine until I try to invoke a servlet. For example, if I invoke a
url like http://localhost/app1/servlet/package.ServletName the result of
calling request.getServletPath() is '/servlet'.

However, if I make the same call when I'm in the servlet the result is
'/servlet/package.ServletName'

Why does it give a different result in the filter and the servlet?

Thanks!

--
View this message in context:
http://www.nabble.com/-OT--request.getServletPath%28%29-val-not-same-in-Filt
er---Servlet-tf2152125.html#a5943443
Sent from the Struts - User forum at Nabble.com.


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


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



about overriding the excute method

2006-08-23 Thread Gomathi
hai,
  what will happen when the execute () of action class is overrided by the 
subclass called dispatch action?.
Regards 
gomes

Re: Question about Lookup dispatch action

2006-08-23 Thread mosho


Yes, that's exactly the way it works.
My navigation with lookupDispatchAction works perfectly. The problem arises
when I have another to link instead of button to submit the form, how do I
pass navigation parameter value then?
The javascript with hidden field doesn't solve the problem.

Thanks!


Scott Van Wart-2 wrote:
> 
> mosho wrote:
>> Request[/planName] does not contain handler parameter named navigation
>>   
> 
> In your struts-config.xml, are you including 'parameter="navigation"' in 
> your action mapping?  A la:
> 
>name="planNameForm" parameter="navigation">
>  ...
>   
> 
> The parameter gives you a place to pass additional data to your action.  
> In the case of LookupDispatchAction, it uses it to find out which 
> request parameter (in this case, "navigation") it should look at to 
> determine which method to call in your subclass.  So your form will 
> submit, and be stuff like:
> 
>   navigation=Next%20Record
> 
> It looks messy, but that's OK.  The framework takes it and translates it 
> back into "Next Record".  Now in your subclass, you override 
> getKeyMethodMap() right?  And somewhere in there, you have something like,
> 
>   map.put( "navigation.next.record", "next" );
> 
> Where "next" corresponds to the public ActionForward next( 
> ActionMapping...) method you have defined in your subclass.
> 
> And in your MessageResources.properties (or whatever the file's called 
> in your web app), you have:
> 
>   navigation.next.record=Next Record
> 
> See how everything links together?  Now the button text you choose is 
> likely different, but this flexibility is the reason you NEVER refer to 
> the button by its text.  Let Struts do that internally, only your users 
> should see it.  Just thought I'd give you a little background so you 
> know what you're getting into; anyone correct me if I'm wrong :)
> 
> Oh one last thing.  Make sure you're NOT overriding execute() in your 
> subclass.  It's fine for regular Action-derived classes, but you're 
> using LookupDispatchAction, which needs to run its own implementation of 
> execute().
> 
> - Scott
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Question-about-Lookup-dispatch-action-tf2124092.html#a5945508
Sent from the Struts - User forum at Nabble.com.


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



Resource bundles and Struts taglibs

2006-08-23 Thread O'Shea, Sean
Hi all,

I'm using struts 1.2.9 and I'm having some trouble with resource
bundles. My JSP looks like this:

<%@ include file="../taglibs.jsp" %>











I'm plugging my resources into my struts-config.xml like this:




Both the bean:message messages get outputted as expected. This means
that the otherBundle resources are definitely registered with the
application.

However, the bean:write message does not get outputted as expected - I
get a ??? errors.foo.bar ??? message on the JSP

I've debugged the tag libraries and I think both bean:message and
bean:write call the org.apache.struts.taglib.TagUtils.message method
detailed below:

public String message(
PageContext pageContext,
String bundle,
String locale,
String key,
Object args[])
throws JspException {

MessageResources resources =
retrieveMessageResources(pageContext, bundle, false);

Locale userLocale = getUserLocale(pageContext, locale);
String message = null;
if (args == null) {
message = resources.getMessage(userLocale, key);
} else {
message = resources.getMessage(userLocale, key, args);
}
if ((message == null) && log.isDebugEnabled()) {
// log missing key to ease debugging
log.debug(resources.getMessage("message.resources", key,
bundle, locale));
}
return message;
}

When the bean:message tag is calling this method, the bundle parameter
has a value of 'otherBundle'.

However, when the bean:write tag calls this method the bundle parameter
is null - hence the ??? errors.foo.bar ??? message in my JSP.

Can someone offer advice on this issue? Do I have my JSP and
struts-config.xml configured correctly?

Any help would be greatly appreciated

Thanks

Sean

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



Re: Resource bundles and Struts taglibs

2006-08-23 Thread Niall Pemberton

On 8/23/06, O'Shea, Sean  wrote:

Hi all,

I'm using struts 1.2.9 and I'm having some trouble with resource
bundles. My JSP looks like this:

<%@ include file="../taglibs.jsp" %>











I'm plugging my resources into my struts-config.xml like this:




Both the bean:message messages get outputted as expected. This means
that the otherBundle resources are definitely registered with the
application.

However, the bean:write message does not get outputted as expected - I
get a ??? errors.foo.bar ??? message on the JSP


Its the  tag that is converting the keys in your error
messages into the text -  is just accessing the page scope
variable that the text has been stored under and writing it out. The
bundle attribute for  is for use with the "formatKey"
attribute.

You need to specify the bundle on the  tag:

 
   
  

Niall


I've debugged the tag libraries and I think both bean:message and
bean:write call the org.apache.struts.taglib.TagUtils.message method
detailed below:

public String message(
PageContext pageContext,
String bundle,
String locale,
String key,
Object args[])
throws JspException {

MessageResources resources =
retrieveMessageResources(pageContext, bundle, false);

Locale userLocale = getUserLocale(pageContext, locale);
String message = null;
if (args == null) {
message = resources.getMessage(userLocale, key);
} else {
message = resources.getMessage(userLocale, key, args);
}
if ((message == null) && log.isDebugEnabled()) {
// log missing key to ease debugging
log.debug(resources.getMessage("message.resources", key,
bundle, locale));
}
return message;
}

When the bean:message tag is calling this method, the bundle parameter
has a value of 'otherBundle'.

However, when the bean:write tag calls this method the bundle parameter
is null - hence the ??? errors.foo.bar ??? message in my JSP.

Can someone offer advice on this issue? Do I have my JSP and
struts-config.xml configured correctly?

Any help would be greatly appreciated

Thanks

Sean

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



Action will be processed two times

2006-08-23 Thread Dirk.Wichmann
Hi all,

I use struts for a long time and have a lot of experience with struts I
think (or better hope)
Now I have the problem that after I submit a form the action of the form
will be processed two times.
The exceptional is that when i run the application in debug mode the
action will only processed ones.
I have no idea, 

Thanks in advance
regards 
Dirk Wichmann

externer Mitarbeiter im Auftrag der
RWE Kundenservice GmbH
Linienprojekt Produkt- und Datenbereinigung
Beethovenstr. 32, 45128 Essen
T intern: 70-20968
T extern: +49(0)201-12-20968
M: +49 (0)170 837 66 59
mailto:[EMAIL PROTECTED]




RE: Action will be processed two times

2006-08-23 Thread Givler, Eric
Is the return forward from your action a forward to an action or to a JSP?


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 7:21 AM
To: user@struts.apache.org
Subject: Action will be processed two times


Hi all,

I use struts for a long time and have a lot of experience with struts I
think (or better hope)
Now I have the problem that after I submit a form the action of the form
will be processed two times.
The exceptional is that when i run the application in debug mode the
action will only processed ones.
I have no idea, 

Thanks in advance
regards 
Dirk Wichmann

externer Mitarbeiter im Auftrag der
RWE Kundenservice GmbH
Linienprojekt Produkt- und Datenbereinigung
Beethovenstr. 32, 45128 Essen
T intern: 70-20968
T extern: +49(0)201-12-20968
M: +49 (0)170 837 66 59
mailto:[EMAIL PROTECTED]



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



Re: Action will be processed two times

2006-08-23 Thread Leon Rosenberg

lemme guess, internet explorer?
Leon

On 8/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hi all,

I use struts for a long time and have a lot of experience with struts I
think (or better hope)
Now I have the problem that after I submit a form the action of the form
will be processed two times.
The exceptional is that when i run the application in debug mode the
action will only processed ones.
I have no idea,

Thanks in advance
regards
Dirk Wichmann

externer Mitarbeiter im Auftrag der
RWE Kundenservice GmbH
Linienprojekt Produkt- und Datenbereinigung
Beethovenstr. 32, 45128 Essen
T intern: 70-20968
T extern: +49(0)201-12-20968
M: +49 (0)170 837 66 59
mailto:[EMAIL PROTECTED]






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



Struts and bean write

2006-08-23 Thread Jean-Marie Pitre
Hi,

I am testing struts 1.3.5 and I have a difference with previous version.

When I call bean:write to display an int property in my jsp page I have
the following value org.apache.struts.taglib.bean.format.int19 instead
of 19.

Have you got an idea ?

Regards,
Jean-Marie.

---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


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



Re: Struts 1.3 and bean write

2006-08-23 Thread Wendy Smoak

On 8/22/06, Jean-Marie Pitre <[EMAIL PROTECTED]> wrote:


I am testing struts 1.3.5 and I have a difference with previous version.

When I call bean:write to display an int property in my jsp page I have
the following value org.apache.struts.taglib.bean.format.int19 instead
of 19.

Have you got an idea ?


Please don't re-post the same question in a new thread.  You can reply
to your original note to bump it up in our in-boxes.

Can you construct a simple JSP that demonstrates the problem?

--
Wendy

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



RE: Resource bundles and Struts taglibs

2006-08-23 Thread O'Shea, Sean
Hi Niall,

Thanks again for your help - your suggestion worked.

Sean 

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 23, 2006 11:03 AM
To: Struts Users Mailing List
Subject: Re: Resource bundles and Struts taglibs

On 8/23/06, O'Shea, Sean  wrote:
> Hi all,
>
> I'm using struts 1.2.9 and I'm having some trouble with resource
> bundles. My JSP looks like this:
>
> <%@ include file="../taglibs.jsp" %>
> 
>  bundle="otherBundle"/>
> 
> 
> 
>  bundle="otherBundle" />
> 
> 
> 
> 
>
> I'm plugging my resources into my struts-config.xml like this:
>
>  null="false"/>
>  null="false"/>
>
> Both the bean:message messages get outputted as expected. This means
> that the otherBundle resources are definitely registered with the
> application.
>
> However, the bean:write message does not get outputted as expected - I
> get a ??? errors.foo.bar ??? message on the JSP

Its the  tag that is converting the keys in your error
messages into the text -  is just accessing the page scope
variable that the text has been stored under and writing it out. The
bundle attribute for  is for use with the "formatKey"
attribute.

You need to specify the bundle on the  tag:

  

   

Niall

> I've debugged the tag libraries and I think both bean:message and
> bean:write call the org.apache.struts.taglib.TagUtils.message method
> detailed below:
>
> public String message(
> PageContext pageContext,
> String bundle,
> String locale,
> String key,
> Object args[])
> throws JspException {
>
> MessageResources resources =
> retrieveMessageResources(pageContext, bundle, false);
>
> Locale userLocale = getUserLocale(pageContext, locale);
> String message = null;
> if (args == null) {
> message = resources.getMessage(userLocale, key);
> } else {
> message = resources.getMessage(userLocale, key, args);
> }
> if ((message == null) && log.isDebugEnabled()) {
> // log missing key to ease debugging
> log.debug(resources.getMessage("message.resources", key,
> bundle, locale));
> }
> return message;
> }
>
> When the bean:message tag is calling this method, the bundle parameter
> has a value of 'otherBundle'.
>
> However, when the bean:write tag calls this method the bundle
parameter
> is null - hence the ??? errors.foo.bar ??? message in my JSP.
>
> Can someone offer advice on this issue? Do I have my JSP and
> struts-config.xml configured correctly?
>
> Any help would be greatly appreciated
>
> Thanks
>
> Sean
>
> -
> 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: Re: select tag and value issue

2006-08-23 Thread Jonathan Drnek
I think I am.  I changed the JSP to also display the license id as a
text field.  The JSP is 


  
  Name  
  Location  
  Approved  
  License ID:   
  License 

 


  Notes 



The HTML that is outputted is 


  
  Name  
  Location  
  Approved  

  License ID: 
  License 

 
Apache Software License
asd

  Notes 



As you can see, the license id has a value of 42.  There is an option
with a value of 42 that is not selected.  If I hard code the 42 so I
have JSP that looks like


 



I get what I expect


 
Apache Software License
asd


Jon

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Tuesday, August 22, 2006 4:53 PM
To: user@struts.apache.org
Subject: Re: select tag and value issue

Your JSP code looks OK (except obviously you want to remove the 
value="22" from the html:select tag). Are you sure the value you're 
setting in form.license is correct?

L.

Jonathan Drnek wrote:
> I'm fairly new to struts and am having a problem with the

> tag. I can't get the value property to work correctly.  I have a list
of
> licenses that I want displayed in the drop down box.  I want the
license
> that is used by the current software to be selected. 
> 
> If I hard code the value property to be 22 for example, the license
that
> has 22 for its key is selected.  It seems like I should be able to use
> the license property in my SoftwareForm bean for the value but that
does
> not work.  When I do that, nothing ends up being selected.
> 
>  My JSP page looks like 
> 
> 
>   
>   Name 
>   Location 
>   Approved 
>   License 
> 
>  
>  labelProperty="name" />
> 
>   Notes 
> 
> 
> 
> My action mapping looks like.
> 
>scope="request"
> type="org.springframework.web.struts.DelegatingActionProxy"
> input="/EditSoftware.jsp">
>path="/loadAllSoftware.do">
>   
>path="/EditSoftware.jsp">
>   
>   
> 
> As you can see I am using spring.  
> 
> My SoftwareForm bean contains the String properties you would expect.

> 
> In the action that forwards to the above form I have the following
code
> 
> Software s = softwareDAO.get(Long.decode(id));
> Iterator i = licenseDAO.getAllLicenses();
> 
> SoftwareForm sForm = new SoftwareForm();
> sForm.setApproved(Boolean.toString(s.isApproved()));
> sForm.setId(s.getId().toString());
> sForm.setLicense(s.getLicense().getId().toString());
> sForm.setLocation(s.getLocation());
> sForm.setName(s.getName());
> sForm.setNotes(s.getNotes());
> 
> request.setAttribute("SoftwareForm",sForm);
> request.setAttribute("allLicenses",i);
> 
> This seems like it should be a fairly simple thing to do.  What am I
> missing?
> 
> Jon


-
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: When my JSP calls the action class SErvlet Exception is thrown.

2006-08-23 Thread Monkeyden

You should really look at the Tomcat logs, as the message mentions.  Perhaps
if you posted the root cause of the exception, and more context, someone
could help you.  That said, what gives you the impression that it's the
Action and not something else, like the ActionForm?  Did it manifest itself
on submit of the form?  On load of the JSP?  Is the ActionForm on the
classpath?  What about the Action?

On 8/23/06, sheetal <[EMAIL PROTECTED]> wrote:


Hi,
During deployment on tomcat,
when my jsp ties to invoke action class,
following error is flashed..

*type* Exception report

*message*

*description* _The server encountered an internal error () that
prevented it from fulfilling this request._

*exception*

javax.servlet.ServletException: Servlet execution threw an exception

*root cause*

java.lang.NoClassDefFoundError
   sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
   sun.reflect.NativeConstructorAccessorImpl.newInstance(
NativeConstructorAccessorImpl.java:39)
   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:27)
   java.lang.reflect.Constructor.newInstance(Constructor.java:494)
   java.lang.Class.newInstance0(Class.java:350)
   java.lang.Class.newInstance(Class.java:303)
   org.apache.struts.util.RequestUtils.applicationInstance(
RequestUtils.java:143)
   org.apache.struts.action.RequestProcessor.processActionCreate(
RequestProcessor.java:280)
   org.apache.struts.action.RequestProcessor.process(
RequestProcessor.java:218)
   org.apache.struts.action.ActionServlet.process(ActionServlet.java
:1194)
   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java
:432)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

*note* _The full stack trace of the root cause is available in the
Apache Tomcat/5.5.17 logs.
_

_Does anybody has any idea why is it so...(Why is the servlet exceotion
thrown)
REgards,
Sheetal
_




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




Re: request processor

2006-08-23 Thread Monkeyden

Classic!  What is the purpose of a lawn mower?  What about a hair brush?  A
screwdriver?

Noun + [implied] Verb = clearly stated purpose

On 8/23/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:


Is this a bad Karnak routine?

Johnny: "To parse requests"
Ed McMahon: "To parse requests"

-tears envelope open-

Johnny: "What is the use of request processor?"

:grin:  Sorry, couldn't resist  :grin:

The RP is essentially the series of steps that Struts goes though when a
request is received and recognized as a request it should handle (i.e.,
mapped to ActionServlet).  ActionServlet delegates to the RP (be it the
monolithic RP of pre-1.3 Struts, or the chain-based RP of Struts 1.3.x).
We're talking steps like populating the associated form bean,
determining which Action to call, etc.

Frank

Gomathi wrote:
> hai,
> what is the use of request processor?
>

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
(2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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




Re: Question about Lookup dispatch action

2006-08-23 Thread Scott Van Wart

mosho wrote:

Yes, that's exactly the way it works.
My navigation with lookupDispatchAction works perfectly. The problem arises
when I have another to link instead of button to submit the form, how do I
pass navigation parameter value then?
The javascript with hidden field doesn't solve the problem.
  

Is the hidden field within the  (here)  tags?

- Scott

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



Re: Question about Lookup dispatch action

2006-08-23 Thread mosho

Hi Scott,

I  added a unspecified() method in my action class and it works now.
I am not able to understand though how it is working, unspecified() is
called when parameter name doesn;t exist, right?
I have a parameter name= navigation and its value is shown as {submitText}.
But it calls unspecified  method, for that value as it would have done if
value is null. 
I am assuming it is calling unspecified() because  it is not able to find
the key name {submitText}

Any idea?

Thanks, you have been very helpful.


Scott Van Wart-2 wrote:
> 
> mosho wrote:
>> Yes, that's exactly the way it works.
>> My navigation with lookupDispatchAction works perfectly. The problem
>> arises
>> when I have another to link instead of button to submit the form, how do
>> I
>> pass navigation parameter value then?
>> The javascript with hidden field doesn't solve the problem.
>>   
> Is the hidden field within the  (here)  tags?
> 
> - Scott
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Question-about-Lookup-dispatch-action-tf2124092.html#a5951171
Sent from the Struts - User forum at Nabble.com.


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



Re: about overriding the excute method

2006-08-23 Thread Leon Rosenberg

the overriding action's method will be called, what do you expect?
leon

On 8/23/06, Gomathi <[EMAIL PROTECTED]> wrote:

hai,
  what will happen when the execute () of action class is overrided by the 
subclass called dispatch action?.
Regards
gomes



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



Re: Question about Lookup dispatch action

2006-08-23 Thread Wendy Smoak

On 8/23/06, mosho <[EMAIL PROTECTED]> wrote:


I  added a unspecified() method in my action class and it works now.
I am not able to understand though how it is working, unspecified() is
called when parameter name doesn;t exist, right?
I have a parameter name= navigation and its value is shown as {submitText}.
But it calls unspecified  method, for that value as it would have done if
value is null.
I am assuming it is calling unspecified() because  it is not able to find
the key name {submitText}

Any idea?


Can you post the Javascript again?  The most recent version I see
above never submits the form.  It's not enough to name the method
'onClickSubmit' -- you actually have to call submit() somewhere, and I
don't see that happening.

--
Wendy

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



Re: select tag and value issue

2006-08-23 Thread Laurie Harper
If you hardcode value="42", the option with value '42' will always be 
selected. If you hardcode value="license", as you have below, the option 
with value 'license' will always be selected -- and you don't have an 
option with that value, so nothing is selected.


You need to *remove* the value=... attribute from the html:select tag. 
Struts will then use the value of the property, as you want; specifying 
the value attribute overrides it.


L.

Jonathan Drnek wrote:

I think I am.  I changed the JSP to also display the license id as a
text field.  The JSP is 



  
  Name  
  Location  
  Approved  
  License ID:   
  License 
			

 


  Notes 



The HTML that is outputted is 



  
  Name  
  Location  
  Approved  

  License ID: 
  License 


 
Apache Software License
asd

  Notes 



As you can see, the license id has a value of 42.  There is an option
with a value of 42 that is not selected.  If I hard code the 42 so I
have JSP that looks like


 



I get what I expect


 
Apache Software License
asd


Jon

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Tuesday, August 22, 2006 4:53 PM
To: user@struts.apache.org
Subject: Re: select tag and value issue

Your JSP code looks OK (except obviously you want to remove the 
value="22" from the html:select tag). Are you sure the value you're 
setting in form.license is correct?


L.

Jonathan Drnek wrote:

I'm fairly new to struts and am having a problem with the



tag. I can't get the value property to work correctly.  I have a list

of

licenses that I want displayed in the drop down box.  I want the

license
that is used by the current software to be selected. 


If I hard code the value property to be 22 for example, the license

that

has 22 for its key is selected.  It seems like I should be able to use
the license property in my SoftwareForm bean for the value but that

does

not work.  When I do that, nothing ends up being selected.

 My JSP page looks like 



  
  Name 
  Location 
  Approved 
  License 


 


  Notes 



My action mapping looks like.








As you can see I am using spring.  


My SoftwareForm bean contains the String properties you would expect.



In the action that forwards to the above form I have the following

code

Software s = softwareDAO.get(Long.decode(id));
Iterator i = licenseDAO.getAllLicenses();

SoftwareForm sForm = new SoftwareForm();

sForm.setApproved(Boolean.toString(s.isApproved()));
sForm.setId(s.getId().toString());
sForm.setLicense(s.getLicense().getId().toString());
sForm.setLocation(s.getLocation());
sForm.setName(s.getName());
sForm.setNotes(s.getNotes());

request.setAttribute("SoftwareForm",sForm);

request.setAttribute("allLicenses",i);

This seems like it should be a fairly simple thing to do.  What am I
missing?

Jon



-
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: Question about Lookup dispatch action

2006-08-23 Thread Michael Jouravlev

On 8/23/06, mosho <[EMAIL PROTECTED]> wrote:

I am assuming it is calling unspecified() because  it is not able to find
the key name {submitText}


Instead of assuming you can verify it. If you are using Firefox,
LiveHTTPHeaders is invaluable plugin for HTTP traffic sniffing.

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



Re: about overriding the excute method

2006-08-23 Thread Monkeyden

"Object Oriented Programming"

I would suggest investing in a copy of Java POOP [
http://stevenf.com/mt/gfx/javapoop.jpg]?  Of course we know it's an acronym
for "Principles of Object Oriented Programming", but good times nonetheless.


On 8/23/06, Leon Rosenberg <[EMAIL PROTECTED]> wrote:


the overriding action's method will be called, what do you expect?
leon

On 8/23/06, Gomathi <[EMAIL PROTECTED]> wrote:
> hai,
>   what will happen when the execute () of action class is overrided by
the subclass called dispatch action?.
> Regards
> gomes
>

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




Re: Question about Lookup dispatch action

2006-08-23 Thread Scott Van Wart

mosho wrote:

Hi Scott,

I  added a unspecified() method in my action class and it works now.
I am not able to understand though how it is working, unspecified() is
called when parameter name doesn;t exist, right?
I have a parameter name= navigation and its value is shown as {submitText}.
But it calls unspecified  method, for that value as it would have done if
value is null. 
I am assuming it is calling unspecified() because  it is not able to find

the key name {submitText}
  

I hope I read your reply correctly.

You should NEVER EVER see "{submitText}" when you're stepping through 
Java, or in the log window, or in an exception stack trace!!!  The ONLY 
place it should appear is in your JSP.  In ALL OTHER PLACES, you should 
see the text that you put in your MessageResources.properties.  If 
you're seeing "{submitText}" verbatim, then your JSP compiler is 
ignoring EL, or it's not written correctly.  For this line in your JSP,


 hiddenField.value = "${submitText}";

Go ahead and request your page in your browser, then go to view source.  
Scroll down to where this line should appear in the HTML, and make sure 
it says something like,


 hiddenField.value = "Next";

instead.

Now there might be a workaround... I gave you the EL method because I 
find it much cleaner than embedding XML-like tags in JavaScript, but the 
following may also work in your JSP:


hiddenField.value = '';

This might work... I don't LIKE it, because it's an XML (tag library, 
whatever) tag inside JavaScript inside HTML in a JSP... but oh well.  
Note the quotes -- the outermost are single quotes, the innermost are 
double quotes.  Double check them even if you copied/pasted them just to 
get into the habit.


If you were using {submitText} in your post as a placeholder for the 
actual text that should appear to the browser, my apologies, though I 
hope you understand what I was getting at :).


If this WAS the case, since you're not using EL, feel free to remove the 
lines I gave you in an earlier post,


 
   
 

As you don't need them.

- Scott


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



Creating a DynaBean from an ActionForm on the fly

2006-08-23 Thread Scott Van Wart
Is it possible to get a DynaBean object from an ActionForm 
programmatically?  I need to create a copy of a form, but cloneBean 
isn't working.  I have a map-based nested bean (which lets me do stuff 
like 'myform.child(ABC).name), but cloneBean does a SHALLOW (argh!) copy 
of the map so the original and the clone have the same map values.


- Scott

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



Re: about overriding the excute method

2006-08-23 Thread Scott Van Wart

Gomathi wrote:

hai,
  what will happen when the execute () of action class is overrided by the 
subclass called dispatch action?.
Regards 
gomes
  
If you mean extending DispatchAction, your execute() method will get 
called.  Unless you have a call to super.execute() (which then calls 
DispatchAction.execute()), your class will pretty much behave like a 
regular Action class, which kind of defeats the purpose of extending 
DispatchAction in the first place.


If you need to do special processing before any of your methods are 
invoked, an idea is to override execute(), do some processing and ensure 
you call super.execute() somewhere appropriate.


- Scott


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



Re: When my JSP calls the action class SErvlet Exception is thrown.

2006-08-23 Thread Scott Van Wart

sheetal wrote:


_Does anybody has any idea why is it so...(Why is the servlet 
exceotion thrown)


Couple of things to check:

- In struts-config.xml, make sure your package names and class names of 
your  and  tags are all spelled correctly, 
including case.
- Do the same for your ActionForm and Action classes, and make sure 
they're in the packages you expect them to be in.
- As a last resort, try cleaning the deployment context (undeploying), 
then clean->build your project and redeploy.


In short, it's probably a typo.

- Scott

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



Re: Question about Lookup dispatch action

2006-08-23 Thread mosho

Hey Scott

FINALLY! It works !!!
Including xml tag in my javascript is the solution for me.

THANKS !


Scott Van Wart-2 wrote:
> 
> mosho wrote:
>> Hi Scott,
>>
>> I  added a unspecified() method in my action class and it works now.
>> I am not able to understand though how it is working, unspecified() is
>> called when parameter name doesn;t exist, right?
>> I have a parameter name= navigation and its value is shown as
>> {submitText}.
>> But it calls unspecified  method, for that value as it would have done if
>> value is null. 
>> I am assuming it is calling unspecified() because  it is not able to find
>> the key name {submitText}
>>   
> I hope I read your reply correctly.
> 
> You should NEVER EVER see "{submitText}" when you're stepping through 
> Java, or in the log window, or in an exception stack trace!!!  The ONLY 
> place it should appear is in your JSP.  In ALL OTHER PLACES, you should 
> see the text that you put in your MessageResources.properties.  If 
> you're seeing "{submitText}" verbatim, then your JSP compiler is 
> ignoring EL, or it's not written correctly.  For this line in your JSP,
> 
>   hiddenField.value = "${submitText}";
> 
> Go ahead and request your page in your browser, then go to view source.  
> Scroll down to where this line should appear in the HTML, and make sure 
> it says something like,
> 
>   hiddenField.value = "Next";
> 
> instead.
> 
> Now there might be a workaround... I gave you the EL method because I 
> find it much cleaner than embedding XML-like tags in JavaScript, but the 
> following may also work in your JSP:
> 
> hiddenField.value = '';
> 
> This might work... I don't LIKE it, because it's an XML (tag library, 
> whatever) tag inside JavaScript inside HTML in a JSP... but oh well.  
> Note the quotes -- the outermost are single quotes, the innermost are 
> double quotes.  Double check them even if you copied/pasted them just to 
> get into the habit.
> 
> If you were using {submitText} in your post as a placeholder for the 
> actual text that should appear to the browser, my apologies, though I 
> hope you understand what I was getting at :).
> 
> If this WAS the case, since you're not using EL, feel free to remove the 
> lines I gave you in an earlier post,
> 
>   
> 
>   
> 
> As you don't need them.
> 
> - Scott
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Question-about-Lookup-dispatch-action-tf2124092.html#a5953411
Sent from the Struts - User forum at Nabble.com.


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



Re: Form Validation

2006-08-23 Thread Scott Van Wart

Chetan Pandey wrote:

Is their a way to specify multiple inputs.
  


Nope.  A wise man once told me that validate="true" is there only for 
convenience.  So the workaround is to do something like 
'validate="false"', omit the input= tag, and add forwards like,



 
 


public void create( ActionMapping mapping, ... ) {

 ActionErrors errors = form.validate( mapping, request );
 if ( errors == null ) {
   errors = new ActionErrors();
 } else if ( !errors.isEmpty() ) {
   saveErrors( errors );
   return mapping.findForward( "add" );
 }

 // Do some stuff

 // ... and success!
 myForm.setId( someObject.getId() );
 return mapping.findForward( "edit" );

}

So if it passes validation and everything checks out okay, it goes to 
the edit page to the newly added record.  Otherwise it goes back to 
add.  You can do the same thing for delete (ie: if you were editing a 
record, but suddenly lose the state of the record you're editing because 
the user is mucking about).


This gives you more power over when and how to do validation, and what 
to do on pass/fail (sometimes you might have to repopulate a few of the 
ActionForm's values--which is something else you can't do with the 
validate="true" shortcut).


- Scott


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



Re: TagExtraInfo ,getVariableInfo

2006-08-23 Thread Scott Van Wart

Raghuveer wrote:

WHy exactly TagExtraInfo to be implemented.
What makes difference it this is used and not used in   in TLD
file


Example:
MessagesTei extends TagExtraInfo {

TagExtraInfo {

   public IterationTEI() {
  super();
   }

   public VariableInfo[] getVariableInfo(TagData data) {

  
Maybe in case you want to localize the information for the tag.  Just a 
guess.


- Scott

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



Re: Can we specify variables in html form tags action attribute

2006-08-23 Thread Scott Van Wart

Chetan Pandey wrote:

pageContext.setAttribute(propertyaction,"propertyaction");%>
  
pageContext.setAttribute() is a standard map-based pattern.  All of 
these use (key, value) and not (value, key) as you have above.  Swap the 
two arguments.


Remember your scope (third parameter).

- Scott

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



[SOLVED] Re: Auto render form bean as hidden fields

2006-08-23 Thread Scott Van Wart

In case anyone's curious, here's the synopsis of my solution:

- Manually annotate (Java 1.5) the private fields I want to "track".
- Have a base class that stores the original state (when a record is 
first loaded from the database, for editing, for example).
- Write a class that walks through the annotated fields, getting their 
type from attributes (types are things like 
simple--hidden,text,etc--nested, or mapped), and writes type="hidden"...> tags for each one.
- Make a tag library to output the JS (exporting page context variables 
is a magical thing indeed) for checking for changes.

- Unit test for a few days :)

The tricky part was the map-based nested beans.  The easy part was 
outputting the  tags.  The hard part was 
realizing that BeanUtils.cloneBean does a shallow copy of Maps.  
Fortunately, the code that walked through the annotations was also able 
to deep-copy the bean.


- Scott


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



one error when I use the dbcp in struts,

2006-08-23 Thread 黄叶

hi, guys.
when I  use the struts and dbcp for configure the database pool.

if the data is very large, the tomcat always throw a exception:

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error
establishing socket.
2006-8-24 9:50:08
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessorprocessChildren
严重: Exception invoking periodic operation:
java.lang.NullPointerException
   at java.util.Arrays.sort(Arrays.java:1078)
   at org.apache.naming.resources.FileDirContext.list(
FileDirContext.java:885)
   at org.apache.naming.resources.FileDirContext.listBindings(
FileDirContext.java:335)
   at org.apache.naming.resources.ProxyDirContext.listBindings(
ProxyDirContext.java:509)
   at org.apache.catalina.loader.WebappClassLoader.modified(
WebappClassLoader.java:734)
   at org.apache.catalina.loader.WebappLoader.modified(
WebappLoader.java:516)
   at org.apache.catalina.core.StandardContext.backgroundProcess(
StandardContext.java:4654)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
(ContainerBase.java:1619)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
(ContainerBase.java:1628)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
(ContainerBase.java:1628)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
ContainerBase.java:1608)
   at java.lang.Thread.run(Thread.java:534)
2006-8-24 9:50:18
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessorprocessChildren
严重: Exception invoking periodic operation:
java.lang.NullPointerException
   at java.util.Arrays.sort(Arrays.java:1078)
   at org.apache.naming.resources.FileDirContext.list(
FileDirContext.java:885)
   at org.apache.naming.resources.FileDirContext.listBindings(
FileDirContext.java:335)
   at org.apache.naming.resources.ProxyDirContext.listBindings(
ProxyDirContext.java:509)
   at org.apache.catalina.loader.WebappClassLoader.modified(
WebappClassLoader.java:734)
   at org.apache.catalina.loader.WebappLoader.modified(
WebappLoader.java:516)
   at org.apache.catalina.core.StandardContext.backgroundProcess(
StandardContext.java:4654)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
(ContainerBase.java:1619)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
(ContainerBase.java:1628)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren
(ContainerBase.java:1628)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
ContainerBase.java:1608)
   at java.lang.Thread.run(Thread.java:534)



My Database is  ms sql server

and my jdk version is 1.4.2
and tomcat is : 5.0.28
Struts version is : 1.2.7

My Struts configure is here:












My Action code is here:

  public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res )
 throws Exception {

 Connection conn = null;

   try {
DataSource dataSource = getDataSource(req);
conn = dataSource.getConnection();
conn.setAutoCommit(true);

// conn = DBManager.getConnection();
// conn.setAutoCommit(true);


res.setContentType("text/plain;charset=UTF-8");
PrintWriter out = res.getWriter();

Parser parser = new Parser(conn, out, servlet.getServletContext
().getRealPath("/upload/add"));
parser.parse();
 } catch ( Exception sqle ) {
Exception e = new Exception();
e.initCause(sqle);
throw e;
 } finally {
   try {
 conn.close();
} catch ( Exception e ) {
   System.err.println("DataBase have a Exception : " + e);
}
 }



 return mapping.findForward("parsesucess");

  }


and I use the connection in Class Parser.

but I directly use the JDBC, but not use the datasource pool
there is not Exception.

why?


Please help me

Thx

Mike.G


[OT][ANN] JAVAWUG BOF XXII / Sun London / 20 Sept 2006 @ 18:30 / featuring Jason van Zyl, Maven 2.0

2006-08-23 Thread Peter . Pilgrim
Hi

I would like to formally announce that ``JAVAWUG'' (Java Web User Group)

is holding the twenty second Birds-of-Feather XXII (Meet up number 22)
at the 
Sun's London Office on Wednesday, 20th September 2006 from 18:30.

For more information 
http://www.jroller.com/page/javawug?entry=announcement_javabof_xxii_jaso
n_van 

The confirmed speakers are:

Jason van Zyl - Architect  - Maven 2.0

Jason van Zyl presents the architecture and infrastructure
behind the declaration software construction framework called
``Maven''.

Jason van Zyl is the Chief Architect and co-founder of
``Mergere, Inc''. Jason co-founded Mergere to deliver an open
source-based build platform for dynamic, distributed,
enterprise-level Java(TM) projects requiring leading-edge
resource orchestration and build management. Jason has over 10
years of enterprise software development experience working
primarily for Fortune 500 companies. Jason is heavily involved
with open source: he is the lead in the development of several
open source projects including Plexus, Modello, and Continuum.


Afterwards members can retire to the nearby bar and restuarant (TBA) ...

The address is:

Sun Microsystems Ltd.
Customer Briefing Centre -- Cheapside Theatre
Regis House
45 King William Street
London
EC4R 9AN

Map (http://uk.sun.com/aboutsun/location/map-london-1.html)


If you would like to attend :

Please REGISTER so that you can be added to the Sun Security Detail.

Join the ``http://groups.google.com/group/javawug'' JAVAWUG at 
Google Groups and Send a mail to the list you are attending 

http://jroller.com/page/javawug

Thanks very much


--
Peter Pilgrim
UBS Investment Bank, 
PTS Portal / IT FIRC OPS LDN,
100 Liverpool Street, London EC2M 2RH, United Kingdom
+44 (0) 20 75 75692
:: Java EE / E-Commerce / Enterprise Integration / Development ::

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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



Problem with JSTL and Struts tag But Not with

2006-08-23 Thread Mississippi John Hurt

Why is it that when I do the below with struts  tag I get an
error "Unterminated text
 
...

but when I use a regular HTML tag, its able to handle the JSTL  fine?


 
 ">text
 
...

Any ideas? I very much want to use the Struts tag and JSTL so I dont have to
hardcode the appname in the href.


RE: Problem with JSTL and Struts tag But Not with

2006-08-23 Thread Vishal Seth
Nested tags...i guess does not work..

-Original Message-
From: Mississippi John Hurt [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 24, 2006 10:48 AM
To: Struts Users Mailing List
Subject: Problem with JSTL and Struts  tag But Not with 

Why is it that when I do the below with struts  tag I get an
error "Unterminated text
  
...

but when I use a regular HTML tag, its able to handle the JSTL 
fine?


  
  ">text
  
...

Any ideas? I very much want to use the Struts tag and JSTL so I dont
have to
hardcode the appname in the href.



MASTEK 
"Making a valuable difference"
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~
Opinions expressed in this e-mail are those of the individual and not that of 
Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
does not accept any responsibility or liability for it. This e-mail and 
attachments (if any) transmitted with it are confidential and/or privileged and 
solely for the use of the intended person or entity to which it is addressed. 
Any review, re-transmission, dissemination or other use of or taking of any 
action in reliance upon this information by persons or entities other than the 
intended recipient is prohibited. This e-mail and its attachments have been 
scanned for the presence of computer viruses. It is the responsibility of the 
recipient to run the virus check on e-mails and attachments before opening 
them. If you have received this e-mail in error, kindly delete this e-mail from 
all computers.
~~


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



When ActionDispatcher to be used ?

2006-08-23 Thread Raghuveer

When does ActionDispatcher action to be used?
org.apache.struts.actions.ActionDispatcher 



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