Bean tag lib help

2003-08-05 Thread Vance Heredia

Hello,

I got a question.  My struts-bean tag doesnot seem to work correctly.

Everytime I use the Bean tag

Eg  

I get a 

java.lang.ClassCastException
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:766)
at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:481)
at org.apache.jsp.files_jsp._jspService(files_jsp.java:149)


The Java code looks like 

  _jspx_th_html_form_0.setParent(_jspx_th_html_html_0);
  _jspx_th_html_form_0.setMethod("POST");
  _jspx_th_html_form_0.setAction("/files");
  149->  int _jspx_eval_html_form_0 = _jspx_th_html_form_0.doStartTag();
  if (_jspx_eval_html_form_0 !=
javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
  out.write("\r\n  ");
  /*   bean:define  */
  java.lang.Object processName = null;
  org.apache.struts.taglib.bean.DefineTag _jspx_th_bean_define_0
= (org.apache.struts.taglib.bean.DefineTag)
_jspx_tagPool_bean_define_property_name_id.get(org.apache.struts.taglib.bean
.DefineTag.class);
  

Doea anyone have any ideas how to fix it 


Vance Heredia

__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.


RE: Bean tag lib help

2003-08-07 Thread Vance Heredia
Thats my code









I changed it as suggested and this was the error I got

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 51 in the jsp file: /files.jsp

Generated servlet error:
[javac] Compiling 1 source file

/usr/local/tomcat-imageshed/work/Standalone/localhost/spooleradmin/files_jsp
.java:154: illegal start of expression
  fully-qualified-class-type-name processName = null;
  ^



An error occurred at line: 51 in the jsp file: /files.jsp

Generated servlet error:
/usr/local/tomcat-imageshed/work/Standalone/localhost/spooleradmin/files_jsp
.java:154: not a statement
  fully-qualified-class-type-name processName = null;
 ^



An error occurred at line: 51 in the jsp file: /files.jsp

Generated servlet error:
/usr/local/tomcat-imageshed/work/Standalone/localhost/spooleradmin/files_jsp
.java:154:  expected
  fully-qualified-class-type-name processName = null;
   ^



Vance Heredia

Java Wireless Architect
Global Applications
Lonely Planet Publications
Email: [EMAIL PROTECTED]
Phone: +61 3 8379 8000

http://www.lonelyplanet.com/
http://mobile.lonelyplanet.com/
http://wap.lonelyplanet.com/
 
-Original Message-
From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 6 August 2003 5:33 PM
To: [EMAIL PROTECTED]
Subject: Re: Bean tag lib help


try



-- nagi


---Original Message---

From: Struts Users Mailing List
Date: Wednesday, August 06, 2003 12:18:43 PM
To: '[EMAIL PROTECTED]'
Subject: Bean tag lib help

Hello,

I got a question. My struts-bean tag doesnot seem to work correctly.

Everytime I use the Bean tag

Eg 

I get a 

java.lang.ClassCastException
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:766)
at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:481)
at org.apache.jsp.files_jsp._jspService(files_jsp.java:149)


The Java code looks like 

_jspx_th_html_form_0.setParent(_jspx_th_html_html_0);
_jspx_th_html_form_0.setMethod("POST");
_jspx_th_html_form_0.setAction("/files");
149-> int _jspx_eval_html_form_0 = _jspx_th_html_form_0.doStartTag();
if (_jspx_eval_html_form_0 !=
javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n ");
/*  bean:define  */
java.lang.Object processName = null;
org.apache.struts.taglib.bean.DefineTag _jspx_th_bean_define_0
= (org.apache.struts.taglib.bean.DefineTag)
_jspx_tagPool_bean_define_property_name_id.get(org.apache.struts.taglib.bean
..DefineTag.class);


Doea anyone have any ideas how to fix it 


Vance Heredia

__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.





  IncrediMail - Email has finally evolved - Click Here 


RE: Bean tag lib help

2003-08-09 Thread Vance Heredia

Ummm don't worry about that last post I re-read it and used the
java.lang.String but it didn't work correctly
Same error  

If anyone has encountered this error I would really appreciate any help

Vance

~~~~~~~~
Vance Heredia

Java Wireless Architect
Global Applications
Lonely Planet Publications
Email: [EMAIL PROTECTED]
Phone: +61 3 8379 8000

http://www.lonelyplanet.com/
http://mobile.lonelyplanet.com/
http://wap.lonelyplanet.com/


> -Original Message-
> From: Vance Heredia 
> Sent: Wednesday, 6 August 2003 5:43 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Bean tag lib help
> 
> 
> Thats my code
> 
> 
>  property="processName" type="fully-qualified-class-type-name" 
> />  property="folder" type="fully-qualified-class-type-name" /> 
>   property="processName"/>  cellspacing="0" cellpadding="0">
> 
> 
> I changed it as suggested and this was the error I got
> 
> org.apache.jasper.JasperException: Unable to compile class for JSP
> 
> An error occurred at line: 51 in the jsp file: /files.jsp
> 
> Generated servlet error:
> [javac] Compiling 1 source file
> 
> /usr/local/tomcat-imageshed/work/Standalone/localhost/spoolera
> dmin/files_jsp
> .java:154: illegal start of expression
>   fully-qualified-class-type-name processName = null;
>   ^
> 
> 
> 
> An error occurred at line: 51 in the jsp file: /files.jsp
> 
> Generated servlet error: 
> /usr/local/tomcat-imageshed/work/Standalone/localhost/spoolera
> dmin/files_jsp
> .java:154: not a statement
>   fully-qualified-class-type-name processName = null;
>  ^
> 
> 
> 
> An error occurred at line: 51 in the jsp file: /files.jsp
> 
> Generated servlet error: 
> /usr/local/tomcat-imageshed/work/Standalone/localhost/spoolera
> dmin/files_jsp
> .java:154:  expected
>   fully-qualified-class-type-name processName = null;
>^
> 
> 
> 
> Vance Heredia
> 
> Java Wireless Architect
> Global Applications
> Lonely Planet Publications
> Email: [EMAIL PROTECTED]
> Phone: +61 3 8379 8000
> 
> http://www.lonelyplanet.com/
> http://mobile.lonelyplanet.com/
> http://wap.lonelyplanet.com/ 
>  
> -Original Message-
> From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, 6 August 2003 5:33 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Bean tag lib help
> 
> 
> try
> 
>  property="processName" type="fully-qualified-class-type-name"/>
> 
> -- nagi
> 
> 
> ---Original Message---
> 
> From: Struts Users Mailing List
> Date: Wednesday, August 06, 2003 12:18:43 PM
> To: '[EMAIL PROTECTED]'
> Subject: Bean tag lib help
> 
> Hello,
> 
> I got a question. My struts-bean tag doesnot seem to work correctly.
> 
> Everytime I use the Bean tag
> 
> Eg  property="processName"/>
> 
> I get a 
> 
> java.lang.ClassCastException
> at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:766)
> at
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:481)
> at org.apache.jsp.files_jsp._jspService(files_jsp.java:149)
> 
> 
> The Java code looks like 
> 
> _jspx_th_html_form_0.setParent(_jspx_th_html_html_0);
> _jspx_th_html_form_0.setMethod("POST");
> _jspx_th_html_form_0.setAction("/files");
> 149-> int _jspx_eval_html_form_0 = _jspx_th_html_form_0.doStartTag();
> if (_jspx_eval_html_form_0 !=
> javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
> do {
> out.write("\r\n ");
> /*  bean:define  */
> java.lang.Object processName = null; 
> org.apache.struts.taglib.bean.DefineTag 
> _jspx_th_bean_define_0 = (org.apache.struts.taglib.bean.DefineTag)
> _jspx_tagPool_bean_define_property_name_id.get(org.apache.stru
> ts.taglib.bean
> ..DefineTag.class);
> 
> 
> Doea anyone have any ideas how to fix it 
> 
> 
> Vance Heredia
> 
> __
> This email, including attachments, is intended only for the 
> addressee and may be confidential, privileged and subject to 
> copyright. If you have received this email in error, please 
> advise the sender and delete it. If you are not the intended 
> recipient of this email, you must not use, copy or disclose 
> its content to anyone. You must not copy or 
> communicate 

RE: How to return to form element

2003-08-11 Thread Vance Heredia

Hms sounds nifty but how would I then display an error message as
well

The more I use JS the more I like it


Vance Heredia


> -Original Message-
> From: Steve Vanspall [mailto:[EMAIL PROTECTED] 
> Sent: Monday, 11 August 2003 1:25 PM
> To: Struts Users Mailing List
> Subject: RE: How to return to form element
> 
> 
> Well I dont know of any easy way to do it
> 
> but you could probably make use of the action errors somehow.
> 
> maybe create, in your message resurces file, a piece of 
> javascript that dynamically set the name of the field to be 
> focused on. Then the onload function would focus on it for 
> you. Sounds a bit complicated but would go something like this.
> 
> -- if form validate --
> boolean firstField = true;
> if(myField == null)
> {
>   if(firstField)
>   {
>   errors.add("javascriptErrors", new 
> ActionError("error.js.field.missing",
> fieldName));
>   firstField = false;
>   }
> 
> }
> 
> -- in message resources --
> 
> error.js.field.missing = focusField = {0}
> 
> -- in page --
> 
> var focusFiled = null;
> 
> 
> 
> 
> 
> 
> 
> 
> That's if you're making use of the message resources feature.
> 
> Just one possible suggestion
> 
> Steve
> 
> 
> -Original Message-
> From: Vance Heredia [mailto:[EMAIL PROTECTED]
> Sent: Monday, 11 August 2003 1:04 PM
> To: '[EMAIL PROTECTED]'
> Subject: How to return to form element
> 
> 
> 
> I use the Action Errors to validate a form.
> 
> If I do find errors does anyone know how to set the focus to 
> the first eroneous field present on the form when it returns to it ???
> 
> Vance
> 
> 
> Vance Heredia
> 
> 
> __
> This email, including attachments, is intended only for the 
> addressee and may be confidential, privileged and subject to 
> copyright.  If you have received this email in error, please 
> advise the sender and delete it.  If you are not the intended 
> recipient of this email, you must not use, copy or disclose 
> its content to anyone.  You must not copy or communicate to 
> others content that is confidential or subject to copyright, 
> unless you have the consent of the content owner.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.


RE: Bean tag help

2003-08-14 Thread Vance Heredia

Hm 

Why do I need a bean name and type in struts-conifg.  

The JSP I'm running is a basic page all it does is user the bean tag eg:



<%@ page language="java" import="java.net.URLEncoder"
contentType="text/html;charset=utf-8" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/controls.tld" prefix="controls" %>



body bgcolor="white" background="/images/PaperTexture.gif">






  
  
  
  



It always dies on the first bean saying it had a ClassCastEsception when
trying to locate the Start tag

I'm not clear asd to why you need to use a bean name and type??

Examples would be good


Vance Heredia


> -Original Message-
> From: Rohit Aeron [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, 7 August 2003 6:36 PM
> To: Struts Users Mailing List
> Subject: RE: Bean tag help
> 
> 
> 
> Just cross check that you are importing 
> 1. taglib
> 2. bean
> 3. correctly specified bean name & type in struts-config.
> 
> Regards
> Rohit
> 
> 
> 
> > Hey People
> > 
> > Ay ideas on how to fix my bean proble?
> > 
> > Every time I try to uyse the  > 
> > java.lang.ClassCastException
> > at 
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:766)
> > at
> > org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:481)
> > at org.apache.jsp.files_jsp._jspService(files_jsp.java:149)
> > 
> > 
> > The Java code looks like
> > 
> >   _jspx_th_html_form_0.setParent(_jspx_th_html_html_0);
> >   _jspx_th_html_form_0.setMethod("POST");
> >   _jspx_th_html_form_0.setAction("/files");
> >   149->  int _jspx_eval_html_form_0 = 
> _jspx_th_html_form_0.doStartTag();
> >   if (_jspx_eval_html_form_0 !=
> > javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
> > do {
> >   out.write("\r\n  ");
> >   /*   bean:define  */
> >   java.lang.Object processName = null;
> >   org.apache.struts.taglib.bean.DefineTag 
> > _jspx_th_bean_define_0 = (org.apache.struts.taglib.bean.DefineTag)
> > 
> _jspx_tagPool_bean_define_property_name_id.get(org.apache.struts.tagli
> > b.bean
> > .DefineTag.class);
> >   
> > 
> > I havent worked a lot on struts and beans so I'm not too 
> sure how to 
> > fix it
> > 
> > Cheers
> > 
> > Vance
> > 
> > 
> > Vance Heredia
> > 
> > 
> > 
> __
> > This email, including attachments, is intended only for the 
> addressee 
> > and may be confidential, privileged and subject to 
> copyright.  If you 
> > have received this email in error, please advise the sender 
> and delete 
> > it.  If you are not the intended recipient of this email, 
> you must not 
> > use, copy or disclose its content to anyone.  You must not copy or 
> > communicate to others content that is confidential or subject to 
> > copyright, unless you have the consent of the content owner.
> > 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> *--
> This message and any attachment(s) is intended only for the 
> use of the addressee(s) and may contain information that is 
> PRIVILEGED and CONFIDENTIAL. If you are not the intended 
> addressee(s), you are hereby notified that any use, 
> distribution, disclosure or copying of this communication is 
> strictly prohibited. If you have received this communication 
> in error, please erase all copies of the message and its 
> attachment(s) and notify the sender or Kanbay postmaster immediately.
> 
> Any views expressed in this message are those of the 
> individual sender and not of Kanbay.
> 
> Although we have taken steps to ensure that this e-mail and 
> any attachment(s) are free from any virus, we advise that in 
> keeping with good computing practice the recipient should 
> ensure they are actually virus free.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.


How to return to form element

2003-08-14 Thread Vance Heredia

I use the Action Errors to validate a form.  

If I do find errors does anyone know how to set the focus to the first
eroneous field present on the form when it returns to it ???

Vance


Vance Heredia


__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.


Bean tag help

2003-08-14 Thread Vance Heredia

Hey People

Ay ideas on how to fix my bean proble?

Every time I try to uyse the   int _jspx_eval_html_form_0 = _jspx_th_html_form_0.doStartTag();
  if (_jspx_eval_html_form_0 !=
javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
  out.write("\r\n  ");
  /*   bean:define  */
  java.lang.Object processName = null;
  org.apache.struts.taglib.bean.DefineTag _jspx_th_bean_define_0
= (org.apache.struts.taglib.bean.DefineTag)
_jspx_tagPool_bean_define_property_name_id.get(org.apache.struts.taglib.bean
.DefineTag.class);
  

I havent worked a lot on struts and beans so I'm not too sure how to fix it

Cheers

Vance

~~~~~~~~
Vance Heredia


__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.


RE: Bean tag help

2003-08-14 Thread Vance Heredia

Huh  Sorry but you've lost me completely ...

Maybe I should have explained that I've never programmed struts before and
that I've been assigned to fix up the work of a person who has left the
project, and while I've understood, overcome and finished most of the
concepts and problems this particular one completely stumps me.

I should also point out that all exmples of http://www.lonelyplanet.com/
http://mobile.lonelyplanet.com/
http://wap.lonelyplanet.com/


> -Original Message-
> From: Steve Armstrong [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 8 August 2003 1:01 PM
> To: Struts Users Mailing List
> Subject: RE: Bean tag help
> 
> 
> Howdy,
> 
> There are a number of things that are incorrect in your example:
> 
> 1. Concerning your definition:
> 
>  property="processName" value = "filesForm" type="java.lang.Object" />
> 
> You can set the value of your scripting variable 
> "processName" from a bean, a property of a bean, or a 
> "hard-coded" value.  I believe you are trying to set your 
> scripting variable from the "processName" property of a bean 
> named "filesForm" (i.e., filesForm.getProcessName()).  
> However, you also specify a value attribute which probably 
> overrides this (I'd have to look at the source code for the 
> tag to see how it is actually resolving this ambiguity) which 
> would set your scripting variable "processName" to the String 
> "filesForm".  This is probably not what you want.
> 
> 2.  I believe that as soon as you use the value attribute, 
> the scripting variable will automatically be set to 
> java.lang.String and your value for the type attribute is 
> promptly ignored.  Once again, I'd have to look at the source 
> for the tag to be 100% sure.  Anyway, you have to set the 
> type attribute correctly if you're getting the value from a 
> bean or the property of a bean, otherwise the type is 
> java.lang.Object by default.  So, if your getter for 
> processName returns a String, specify that the type of the 
> define is java.lang.String.
> 
> 3. There is no need to create a scripting variable as above 
> to be able to do .  This 
> is saying that you want to create an HTML form input tag of 
> type hidden with the value of the named property associated 
> with the form bean that is associated with your action. I 
> assume that "filesForm" is the bean associated with your 
> action, and it has a property named "processName".  If this 
> is a request scope form bean, and the value of "processName" 
> isn't editable (i.e., it isn't used in a text field on your 
> form), and you want its original value to be set in your form 
> bean when the form is submitted, then the html:hidden tag is 
> all you need. Your bean:define is trying to set a scripting 
> variable with the same name (and value) as your form bean 
> property and has nothing to do with the task you're trying to 
> accomplish (I believe).
> 
> Cheers,
> -Steve
> 
> -Original Message-
> From: Vance Heredia [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 07, 2003 8:33 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Bean tag help
> 
> 
> 
> Hm
> 
> Why do I need a bean name and type in struts-conifg.
> 
> The JSP I'm running is a basic page all it does is user the 
> bean tag eg:
> 
> 
> 
> <%@ page language="java" import="java.net.URLEncoder" 
> contentType="text/html;charset=utf-8" %> <%@ taglib 
> uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib 
> uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib 
> uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ taglib 
> uri="/WEB-INF/controls.tld" prefix="controls" %>
> 
> 
> 
> body bgcolor="white" background="/images/PaperTexture.gif">
> 
> 
> 
> 
> 
> 
>property="processName" value = "filesForm" type="java.lang.Object" />
>value = "filesForm" type="java.lang.Object" />
>   
>   
> 
> 
> 
> It always dies on the first bean saying it had a 
> ClassCastEsception when trying to locate the Start tag
> 
> I'm not clear asd to why you need to use a bean name and type??
> 
> Examples would be good
> 
> 
> Vance Heredia
> 
> 
> > -Original Message-
>