Re: redirecting to Google...

2004-03-16 Thread Timothy Stone
Timothy Stone wrote:

List,

Struts noob.

I'm checking a form for a parameter that determines whether the user is 
searching the web at large or the local site:

SiteĀ 
Web
If "false".equalsIgnoreCase( isLocal ) then my 
actionMapping.findForward( "gogoGoogleSearch" ) is envoked.

This is where I get lost... I need to format the query string and pass 
it to Google in the redirect. At a minimum Google looks for a query 
string like:

http://www.google.com/search?q=hearts

How do I do this? I think I'm looking for something similar to this, 
which is what I'm most familiar with:

response.sendRedirect("http://www.google.com/search?q="; + queryString);

What about:

if( "false".equalsIgnoreCase( isLocal ) ) {
return( new ActionForward( "http://www.google.com/search?q="; +
   query, true );
}
I can't seem to find a way of envoking this via the struts-config.xml 
and a logical mapping name.

The docs seem to suggest that this is okay.

Thoughts?






doesn't seem to be doing enough.

Many thanks in advance!

Warmest Regards,
Tim
-
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]


redirecting to Google...

2004-03-16 Thread Timothy Stone
List,

Struts noob.

I'm checking a form for a parameter that determines whether the user is 
searching the web at large or the local site:

SiteĀ 
Web
If "false".equalsIgnoreCase( isLocal ) then my 
actionMapping.findForward( "gogoGoogleSearch" ) is envoked.

This is where I get lost... I need to format the query string and pass 
it to Google in the redirect. At a minimum Google looks for a query 
string like:

http://www.google.com/search?q=hearts

How do I do this? I think I'm looking for something similar to this, 
which is what I'm most familiar with:

response.sendRedirect("http://www.google.com/search?q="; + queryString);





doesn't seem to be doing enough.

Many thanks in advance!

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


Re: instead of

2004-02-13 Thread Timothy Stone
Paul McCulloch wrote:
I don't beleve this will submit the values in the form's input fields. I've
achieved this functionality by having links which use javascript to set the
dispatch form value & call submit.
Paul

I was going to say the same thing.

Try something like
	Submit Query

The HREF provides a non-Javascript browser a backup (section 508, WAI, 
etc). The "return false;" of onclick ensures that the event replaces the 
default behavior of the link, and the onkeypress further meets section 
508, where mouse use is limited or not possible (think non-sighted 
users). I suppose one can do this in a Struts specific manner if desired 
of course. But I'm a Struts newbie.

If anyone wishes to provide the "Struts-way," please do so.

HTH,
Tim


-Original Message-
From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED]
Sent: 12 February 2004 19:45
To: Struts Users Mailing List
Subject: RE:  instead of 
Wouldn't query parameters work here?

How abt using 

HTH..

-jayash



-Original Message-
From: Dieter Mummenschanz [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 12:46 PM
To: [EMAIL PROTECTED]
Subject:  instead of 
Hello,

I have a jsp page with some  buttons. The 
servlet identifies
the klicked button by invoking httpservletrequest.getParameter("...").
Is there a way to use links in my .jsp page using  
instead of
?

Thx for any help,
Dieter


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


Re: NEWBIE: [CLOSED] difficulties getting simple no bean page working...

2004-02-12 Thread Timothy Stone
List,

Too close and too embarrassed to say what it was. Okay, I'll say...

Timothy Stone wrote:

List,

I'm a Struts newbie with a lot of general hours in Tomcat. I want to 
advance my development with Struts 1.1 and Model 2.
...snip...

Step 3. Create the Action subclass

package webAppDev;

import javax.servlet.http.*;
import org.apache.struts.action.*;
public class SearchAction1 extends Action {
public ActionForward execute( ActionMapping mapping, Action form,
  HttpServletRequest request,
  HttpServletResponse response )
throws Exception {
return( mapping.findForward( "success" ) );
}
}
Can you see it? I incorrectly pass an Action object where Action#execute 
expects an ActionForm! Typo Grande. Where I say "Action form", I meant 
to type "ActionForm form".

Now explain how that compiles? Action is not a subclass of ActionForm.

...snip...

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


Re: NEWBIE: difficulties getting simple no bean page working...

2004-02-12 Thread Timothy Stone
Daniel Kalcevich wrote:

If you do not want to use a FormBean and your action solely calls a
success page, maybe you could use the Forward Action build into Struts.
Then it would do a forward directly to the JSP page.
Daniel,

Thanks. So I edited my struts-config.xml:

> Step 4. Update struts-config.xml
>
>  
>type="webAppDev.SearchAction1"
>  name="noBean"
>  scope="request"
>  input="/webAppDev/strutsSearch.jsp"
>   forward="/webAppDev/SearchEngines">
>  
>  
>  
>
And it started working. I assume this is what you described.

However, what's wrong with the first attempt? I have been pouring over 
the archives, the how-tos, and the documentation. My syntax appears 
correct, it is even shown in examples as a working action-mappings element.

I really would like to understand this. Blindly leaving the problem 
means I may face it again without the context, of "why?".

Many thanks,
Tim


-Original Message-
From: Timothy Stone [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 12, 2004 9:15 AM
To: [EMAIL PROTECTED]
Subject: NEWBIE: difficulties getting simple no bean page working...

List,

I'm a Struts newbie with a lot of general hours in Tomcat. I want to 
advance my development with Struts 1.1 and Model 2.

In an applied Struts scenario I have performed the following:

Followed closely the suggestions for integrating Struts into an existing

web application. I did do one thing that deviated, I moved all of the 
Struts TLDs into a subdirectory of WEB-INF (tlds/) per my usual 
development/deployment practice (I did correct the web.xml to reflect 
this move.)

However, I'm having a helluva time getting a very simple application to 
use Struts (I applying the Struts model to a development sandbox I use).

Step 1. Add servlet and servlet-mapping to web app web.xml

 
 action
 
 org.apache.struts.action.ActionServlet
 
 
 config
 
   /WEB-INF/struts-config.xml
 
 
 1
 
 ...
 
 action
 *.do
 
 ...

Step 2. Create the form for input

strutsSearch.html:

...

 ...

...
Step 3. Create the Action subclass

package webAppDev;

import javax.servlet.http.*;
import org.apache.struts.action.*;
public class SearchAction1 extends Action {
 public ActionForward execute( ActionMapping mapping, Action form,
   HttpServletRequest request,
   HttpServletResponse response )
 throws Exception {
 return( mapping.findForward( "success" ) );
 }
}
Step 4. Update struts-config.xml

 
 
 
 
 
Step 5. Test

http://localhost:8080/webAppDev/strutsSearch.jsp

[click submit]

http://localhost:8080/webAppDev/action/search1.do loads but returns an 
empty page.

My success mapping "/webAppDev/SearchEngines" should read some request 
parameters and further redirect to a Search Engine, i.e. Google. It 
works otherwise without Struts.

What am I doing wrong? I must be too close. Everything seems to be 
configured correctly. A typo? A config?

Many thanks in advance for any suggestions,
Tim
-
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]


NEWBIE: difficulties getting simple no bean page working...

2004-02-12 Thread Timothy Stone
List,

I'm a Struts newbie with a lot of general hours in Tomcat. I want to 
advance my development with Struts 1.1 and Model 2.

In an applied Struts scenario I have performed the following:

Followed closely the suggestions for integrating Struts into an existing 
web application. I did do one thing that deviated, I moved all of the 
Struts TLDs into a subdirectory of WEB-INF (tlds/) per my usual 
development/deployment practice (I did correct the web.xml to reflect 
this move.)

However, I'm having a helluva time getting a very simple application to 
use Struts (I applying the Struts model to a development sandbox I use).

Step 1. Add servlet and servlet-mapping to web app web.xml


action

org.apache.struts.action.ActionServlet


config

  /WEB-INF/struts-config.xml


1

...

action
*.do

...

Step 2. Create the form for input

strutsSearch.html:

...

...

...
Step 3. Create the Action subclass

package webAppDev;

import javax.servlet.http.*;
import org.apache.struts.action.*;
public class SearchAction1 extends Action {
public ActionForward execute( ActionMapping mapping, Action form,
  HttpServletRequest request,
  HttpServletResponse response )
throws Exception {
return( mapping.findForward( "success" ) );
}
}
Step 4. Update struts-config.xml






Step 5. Test

http://localhost:8080/webAppDev/strutsSearch.jsp

[click submit]

http://localhost:8080/webAppDev/action/search1.do loads but returns an 
empty page.

My success mapping "/webAppDev/SearchEngines" should read some request 
parameters and further redirect to a Search Engine, i.e. Google. It 
works otherwise without Struts.

What am I doing wrong? I must be too close. Everything seems to be 
configured correctly. A typo? A config?

Many thanks in advance for any suggestions,
Tim
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Struts and Xdoclet

2003-10-23 Thread Timothy Stewart
Figured out my own problem.  It seems that you have to have the struts.jar
and commons-validator.jar in the class path for the WebDocletTask else it
can't generate the form entry.

Happy Diwali

Timmy

-Original Message-
From: Timothy Stewart 
Sent: Thursday, October 23, 2003 2:07 PM
To: [EMAIL PROTECTED]
Subject: Struts and Xdoclet


Anyone using struts with xdoclet.

I have the following form bean

import org.apache.struts.validator.ValidatorForm;

/**
 * @struts.form name="LoginForm"
 */
public class LoginForm extends ValidatorForm
{
private String _userName;
  public LoginForm()
  {
super();
  }

public String getUserName()
{
return _userName;
}

/**
 * 
 * @struts.validator type="required" msgkey="password.required" 
 */
public void setUserName(String string)
{
_userName = string;
}
}

and I am using xdoclet task as such














  







Running this task generates some information to the validation.xml and the
struts-config.xml.

but it doesn't put the formbean element for this form into the form-beans
section.
  
  

  

What am I doing wrong

Thanks,
Timmy




This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.

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


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.

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



Struts and Xdoclet

2003-10-23 Thread Timothy Stewart
Anyone using struts with xdoclet.

I have the following form bean

import org.apache.struts.validator.ValidatorForm;

/**
 * @struts.form name="LoginForm"
 */
public class LoginForm extends ValidatorForm
{
private String _userName;
  public LoginForm()
  {
super();
  }

public String getUserName()
{
return _userName;
}

/**
 * 
 * @struts.validator type="required" msgkey="password.required" 
 */
public void setUserName(String string)
{
_userName = string;
}
}

and I am using xdoclet task as such














  







Running this task generates some information to the validation.xml and the
struts-config.xml.

but it doesn't put the formbean element for this form into the form-beans
section.
  
  

  

What am I doing wrong

Thanks,
Timmy




This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.

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



RE: javax.servlet.ServletException: Missing message for key "inde x.title"

2003-10-15 Thread Timothy Stewart
Ended up being

  
action
org.apache.struts.action.ActionServlet

application

org.apache.struts.webapp.example.ApplicationResources



in my struts-config.xml I have defined

  
  

  
  

When I look at the server debug output it reads

17:06:54,917 INFO  [PropertyMessageResources] Initializing,
config='org.apache.struts.webapp.example.AlternateApplicationResources',
returnNull=true

Nothing about the ApplicationResources,  Until I added the init-param in the
web.xml.

Where can I find documentation on this struts-config.xml file.  Are you not
supposed to have a message-resource without a key?  
Do you always have to pass the init param to the servlet for a
message-resource without a key?

Thanks Everyone that Suggested solutions,
Timmy




-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 15, 2003 4:21 PM
To: Struts Users Mailing List
Subject: Re: javax.servlet.ServletException: Missing message for key
"index.title"


 

   
 action
 org.apache.struts.action.ActionServlet
 
   application
   resources.properties.messages
 
 

-Martin Gainty

*Everything has a price..*

- Original Message - 
From: "Timothy Stewart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 15, 2003 5:56 PM
Subject: javax.servlet.ServletException: Missing message for key
"index.title"


> I am trying to view the struts-example/index.jsp
>
> when the page loads I get the
> javax.servlet.ServletException: Missing message for key "index.title"
>
> I found the entry in ApplicationResources.properties that defines
> index.title.
> I verified that the ApplicationResources.properties is in the war
>
> I check the documentation for the example and it says
>
> If you check the application's web.xml, you will see how these objects are
> loaded. The message resource is loaded by the application parameter to the
> ActionServlet. When the ActionServlet initializes, it parses the
> ApplicationResources.properties in the package folder into the default
> message resource. If you change a message in the resource, and then reload
> the application, it will appear throughout the application.
>
> I looked at the web.xml and found no mention of the
> ApplicationResources.properties.
>
>   
> action
> org.apache.struts.action.ActionServlet
> 
>   config
>   /WEB-INF/struts-config.xml,
> /WEB-INF/struts-config-registration.xml
> 
> 1
>   
>
> I looked at the javadoc for the ActionServlet,  it mentions nothing about
> the resource parameter for the ActionServlet.
>
> How does the Struts framework find these resources? Why is mine failing?
>
> Thanks,
> Timmy
>
>
>
>
>
>
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity to
> which it is addressed. If the reader of this e-mail is not the intended
> recipient or his or her authorized agent, the reader is hereby notified
that
> any dissemination, distribution or copying of this e-mail is prohibited.
If
> you have received this e-mail in error, please notify the sender by
replying
> to this message and delete this e-mail immediately.
>
> -
> 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]


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.

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



javax.servlet.ServletException: Missing message for key "index.ti tle"

2003-10-15 Thread Timothy Stewart
I am trying to view the struts-example/index.jsp

when the page loads I get the
javax.servlet.ServletException: Missing message for key "index.title" 

I found the entry in ApplicationResources.properties that defines
index.title.
I verified that the ApplicationResources.properties is in the war

I check the documentation for the example and it says

If you check the application's web.xml, you will see how these objects are
loaded. The message resource is loaded by the application parameter to the
ActionServlet. When the ActionServlet initializes, it parses the
ApplicationResources.properties in the package folder into the default
message resource. If you change a message in the resource, and then reload
the application, it will appear throughout the application.

I looked at the web.xml and found no mention of the
ApplicationResources.properties.

  
action
org.apache.struts.action.ActionServlet

  config
  /WEB-INF/struts-config.xml,
/WEB-INF/struts-config-registration.xml

1
  

I looked at the javadoc for the ActionServlet,  it mentions nothing about
the resource parameter for the ActionServlet.  

How does the Struts framework find these resources? Why is mine failing?

Thanks,
Timmy






This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.

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



Re: form bean reference....

2002-04-10 Thread timothy

i want to fill some information to other formbean

and forward the page to that JSP

eg.  JSP1->->Action1-> set some data to formBean2->forward to JSP2

so JSP2 can display my new value that set by action1


- Original Message -
From: "James Mitchell" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, April 11, 2002 12:59 PM
Subject: RE: form bean reference


> What exactly are you trying to do?
>
> Are you trying to forward from one action class to another?
>
> JM
>
>
>
> > -Original Message-
> > From: timothy [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, April 10, 2002 11:29 PM
> > To: [EMAIL PROTECTED]
> > Subject: form bean reference
> >
> >
> > Hi all expert,
> >
> > i want to access this formBean (ResultForm) from other Action
> > how can i get the reference
> >
> >  >type="ui.result.ResultAction"
> >name="ResultForm"
> >   scope="session"
> >   input="result.jsp"
> >   >
> > 
> >
> > it did try this, but it does not work any idea
> >
> >  HttpSession session = request.getSession(true);
> >  ResultForm resultForm = (ResultForm)session.getAttribute("ResultForm");
> >
> >
> > From Timothy
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


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




form bean reference....

2002-04-10 Thread timothy

Hi all expert, 

i want to access this formBean (ResultForm) from other Action
how can i get the reference




it did try this, but it does not work any idea

 HttpSession session = request.getSession(true);
 ResultForm resultForm = (ResultForm)session.getAttribute("ResultForm");


>From Timothy


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




RE: internationalisation question

2002-01-29 Thread Timothy Wild

Thanks you all. Turns out it was a combination of two things:
 - My deploy script wasn't copying the localised resource file to the war
file
 - It seems you do have to use a valid language/country code, although i'm
not 100% sure of that at this stage.

Cheers

Tim Wild

-Original Message-----
From: Timothy Wild [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 29, 2002 7:52 AM
To: '[EMAIL PROTECTED]'
Subject: internationalisation question


Hi

This question has probably been asked before, but I can't find it anywhere
in the archives :-(

I am trying to create a basic proof-of-concept demo using struts. Everything
is going great except I can't seem to get multiple languages going. I am
trying to create English (en_IE) and Swedish Chef (ss_IE) versions of the
app. I have two resource files, ApplicationResources.properties and
ApplicationResources_ss.properties, and the following entry in my web.xml

  
  application
 
com.marrakech.strutstest.ApplicationResources


To allow the user to change their language I invoke an action which includes
the following code:

  locale = new Locale("ss", "IE");
  setLocale(request, locale);

I have confirmed that the locale is set in the session. When I try display
text from the resource file I use a tag like this:



Does anyone know why the swedish chef version of the application is not
being picked up?

Thanks and regards

Tim Wild
--
"Blessed is the man who, having nothing to say, abstains from giving words
in evidence of the fact."
- George Elliot 



**

Privileged/Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such person),
you may not copy or deliver this message to anyone. In such
case, you should destroy this message and kindly notify the
sender by reply email. Please advise immediately if you or your
employer do not consent to Internet email for messages of this
kind. Opinions, conclusions and other information in this message
that do not relate to the official business of Marrakech and shall
be understood as neither given nor endorsed by it.

**


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



internationalisation question

2002-01-29 Thread Timothy Wild

Hi

This question has probably been asked before, but I can't find it anywhere
in the archives :-(

I am trying to create a basic proof-of-concept demo using struts. Everything
is going great except I can't seem to get multiple languages going. I am
trying to create English (en_IE) and Swedish Chef (ss_IE) versions of the
app. I have two resource files, ApplicationResources.properties and
ApplicationResources_ss.properties, and the following entry in my web.xml

  
  application
 
com.marrakech.strutstest.ApplicationResources


To allow the user to change their language I invoke an action which includes
the following code:

  locale = new Locale("ss", "IE");
  setLocale(request, locale);

I have confirmed that the locale is set in the session. When I try display
text from the resource file I use a tag like this:



Does anyone know why the swedish chef version of the application is not
being picked up?

Thanks and regards

Tim Wild
--
"Blessed is the man who, having nothing to say, abstains from giving words
in evidence of the fact."
- George Elliot 



**

Privileged/Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such person),
you may not copy or deliver this message to anyone. In such
case, you should destroy this message and kindly notify the
sender by reply email. Please advise immediately if you or your
employer do not consent to Internet email for messages of this
kind. Opinions, conclusions and other information in this message
that do not relate to the official business of Marrakech and shall
be understood as neither given nor endorsed by it.

**




Re: CHARACTER ENCODING !

2002-01-23 Thread timothy

Hi Dennis Lee,

after you use native2ascii.exe, the encoding become UTF8

so "<%@ page contentType="text/html; charset=UTF8" %> will work


if you want to use big5   you need to convert it before (let say in the
getXXX of javaBean  then it will work


>From Timothy
Strategus Partners Ltd



- Original Message -
From: "Lee, Dennis" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 10:48 AM
Subject: RE: CHARACTER ENCODING !


> Hi,
>
> I have exactly the same problem.
> I try to convert the chinese in the properties file to unicode using
> native2ascii but it doesn't work.
> "<%@ page contentType="text/html; charset=big5" %>" + native2ascii  =
> "?", all chinese characters becomes '??'.
>
> Anybody can give some more help ?
>
> Best Regards,
> Dennis Lee
>
> -Original Message-
> From: Christopher Cheng [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 10:11 AM
> To: Struts Users Mailing List
> Cc: wojtek
> Subject: RE: CHARACTER ENCODING !
>
>
> Same here. I am building a site using English, Traditional and Simplified
> Chinese. It is fine if I do not set the encoding to "big5" or whatever in
> JSP header, but I have to manually change the encoding in IE. What is
> strange is that if I put some chinese characters directly in the JSP,
those
> characters are displayed properly, but those from the property files are
> disrupted.
>
> Anybody can help?
>
> -Original Message-
> From: wojtek [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 1:01 AM
> To: Struts Users Mailing List
> Subject: CHARACTER ENCODING !
>
>
> Hi,
>
> I am using struts form some form validation (obvious isn't it?) and I came
> across the following error:
>
>
> National Polish characters returned from the forms are badly encoded !
>
> I am using struts on win2k, jdk 1.3, the jsp page charset is set to
> ISO-8859-2
>
> Can anyone help ?
>
> regards
>
> Wojtek
>
>
>
>
> --
> Myslisz o otworzeniu wlasnego sklepu internetowego?
> A moze o wynajeciu stoiska w wirtualnym pasazu?
> W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> **
> This message and any files transmitted with it are confidential and
> may be privileged and/or subject to the provisions of privacy legislation.
> They are intended solely for the use of the individual or entity to whom
they
> are addressed. If the reader of this message is not the intended
recipient,
> please notify the sender immediately and then delete this message.
> You are notified that reliance on, disclosure of, distribution or copying
> of this message is prohibited.
>
> Bank of Bermuda
> **
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


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




Re: a list of radio button

2002-01-17 Thread timothy

Still does not work  :<help
- Original Message -
From: "Keith Bacon" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, January 17, 2002 7:12 PM
Subject: Re: a list of radio button


> try changing the name= to:-
> 
> struts will call myCollectionElement.getAns() to get the string to label
each radio button.
> Keith (not an expert!).
>
> --- timothy <[EMAIL PROTECTED]> wrote:
> > Hi expert,
> >
> > i want to generate this:
> >
> >  
> >  Element Value: one
> >  
> >  Element Value: two
> >
> > but i get the following result:
> >
> >  
> >  Element Value: one
> >  
> >  Element Value: two
> >
> > the code i use is :
> >
> >  
> >  
> >
> >  Element Value: 
> >  
> >
> >*queryForm is a formBean
> >*answers is queryForm's property which return a
Collection Class
> >*ans is a String
> >
> > how can i solve the problem?
> >
> > thx
> >
> >
> >
> >
> >
> >
>
>
> __
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


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




a list of radio button

2002-01-17 Thread timothy

Hi expert, 

i want to generate this:

  
 Element Value: one
  
 Element Value: two

but i get the following result:

  
 Element Value: one
  
 Element Value: two

the code i use is :

 
  
 Element Value: 
 

   *queryForm is a formBean
   *answers is queryForm's property which return a Collection Class
   *ans is a String

how can i solve the problem?

thx
 



   



Re: Exception with struts

2001-12-19 Thread Timothy Reaves

Both NetBeans & Struts-Console show the file is valid.

On Wed, 19 Dec 2001 10:21:29 -
"Jon.Ridgway" <[EMAIL PROTECTED]> wrote:

> Hi Timothy,
> 
> It looks like you may have a problem with your struts-config.xml file.
Try> putting it through an xml validator, like XML Spy or download the
Struts> console app (search archive for URL) and validate it that way.
> 
> Jon.
> 
> -Original Message-
> From: Timothy Reaves [mailto:[EMAIL PROTECTED]] 
> Sent: 19 December 2001 01:09
> To: Struts
> Subject: Exception with struts
> 
>   Hello all.  I'm trying to learn Struts.  I'm reading Profesional
> JSP,
> which has a chapter on Struts.  I have built their example app, and
> deployed it.  The main page comes up properly ( for a CD store), but
when> I do anything else, I get the following.  Any ideas?
> 
> type Exception report
> 
> message Internal Server Error
> 
> description The server encountered an internal error (Internal Server
> Error) that prevented it from fulfilling this request.
> 
> exception
> 
> javax.servlet.ServletException: Parsing error processing resource path
> /WEB-INF/struts-config.xmlat
>
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:130>
6)  at> org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
>   at javax.servlet.GenericServlet.init(GenericServlet.java)
>   at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java)
>   at
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java)
> 
> ...
> root cause
> 
> java.lang.IllegalArgumentException: object is not an instance of
declaring> classat
> org.apache.struts.digester.Digester.startElement(Digester.java:501)   at
>
org.xml.sax.helpers.XMLReaderAdapter.startElement(XMLReaderAdapter.java:3>
29) at>
org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)   at>
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLVali>
dator.java:1214)...> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:  
<mailto:[EMAIL PROTECTED]>> For additional
commands, e-mail: <mailto:[EMAIL PROTECTED]>> 

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




Exception with struts

2001-12-18 Thread Timothy Reaves

Hello all.  I'm trying to learn Struts.  I'm reading Profesional JSP,
which has a chapter on Struts.  I have built their example app, and
deployed it.  The main page comes up properly ( for a CD store), but when
I do anything else, I get the following.  Any ideas?

type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server
Error) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Parsing error processing resource path
/WEB-INF/struts-config.xml  at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:130
6)  at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
at javax.servlet.GenericServlet.init(GenericServlet.java)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java)

...
root cause

java.lang.IllegalArgumentException: object is not an instance of declaring
class   at
org.apache.struts.digester.Digester.startElement(Digester.java:501) at
org.xml.sax.helpers.XMLReaderAdapter.startElement(XMLReaderAdapter.java:3
29) at
org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)   at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLVali
dator.java:1214)...

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: jsp vs do

2001-07-02 Thread Timothy Shadel

One thing to note, however, is that the internationalization ( tags) 
won't go to non-default mappings unless you use a *.do extension.  I can't remember if 
our tests showed that going first to a *.do and then to a *.jsp worked or not...I 
don't think so.  If you need to make your login screen available (to continue the 
example) in several languages, you need to link to the *.do version, and write your 
Action class in a way that either won't auto-validate the ActionForm, or won't require 
info up front.

Tim Shadel

>>> "Gregor Rayman" <[EMAIL PROTECTED]> 07/02/01 11:52AM >>>
"Anthony Martin" <[EMAIL PROTECTED]> wrote:

> In general, however, you can go to actions directly as long as you supply
> the required fields in the url (if any).
> 
> In the case of the struts-example, going to logon.do gives a validation
> error because it was expecting the correct query string.  For example:
> 
> http://localhost/struts-example/logon.do?username=foo&password=bar 
> 
> 
> Anthony

Yes, you can always go directly to the action, as long as you provide
the necessary data. Some actions do not need any input at all. (e. g. 
/admin/restart.do)

It wouldn't be very bad to go directly to login.do without any data, since
this would simply report an error and forward to its input (login.jsp)
itself.


--
gR


> 
> -Original Message-
> From: Gregor Rayman [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, July 02, 2001 10:28 AM
> To: [EMAIL PROTECTED] 
> Subject: Re: jsp vs do
> 
> 
> "Anthony Martin" <[EMAIL PROTECTED]> wrote:
> 
> 
> > This is how I understand it.  A .do maps to an action then to a .jsp.  If
> > you link directly to a .jsp, the action never executes.  Actions are
> mapped
> > to a .jsp in the struts-config.xml file.
> > 
> > I'm sure there are more clear explanations to follow.
> > 
> > 
> > Anthony
> 
> DO takes you to an action which needs some input from your currently
> displayed from. If you don't have yet the data necessary for the
> action, you cannot go to the action. In such case you can go to 
> HTML or JSP, which contains the input fields you can fill out and
> submit to a DO action.
> 
> In the example application, the link goes to login.jsp, since it is 
> the place where you can enter the credentials. They are then validated
> in a action (DO). You cannot go to the action directly, since you 
> do not have the username/password yet.
> 
> --
> gR
> 





Re: Calendar Tag Library

2001-06-19 Thread Timothy Shadel

No, but we'd like one too.  We're looking for something to allow the user to choose a 
date, and then probably populate a string field that's eventually converted to a date. 
 Right now the closest we've come is a popup JavaScript calendar like that found at 

http://developer.iplanet.com/viewsource/husted_calendar/husted_calendar.html 

>>> "Matt Raible" <[EMAIL PROTECTED]> 06/18/01 02:41PM >>>
Does anyone know of JSP Tag Libraries that can be used to render a Calendar?

Thanks,

Matt




Form with request scope

2001-06-11 Thread Timothy Hicks

I am trying to create a form which has request scope, so that it can be
autopopulated when the form is displayed.  However, when I go to the jsp
the fields are not filled in and if I put debug statements in
FormTag.doStartTag() I realize that the form is tied to a session scope.
The following is the code I am using.  Any thoughts?


<%@page language="java" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>




 
  VENDOR INFORMATION
 


   
  Company Information
   
  VENDOR NUMBER
  
 
  A/P NUMBER
  
 
  COMPANY NAME
  


   
  Contact Information
   
  CONTACT FIRST NAME
  
 
  CONTACT LAST NAME
  
 
  ADDRESS
  

  
  STREET ADDRESS LINE 1

  
  

  
  STREET ADDRESS LINE 2

  
  
  
  
  

  
  CITY
  REGION/STATE
  COUNTRY
  POSTAL CODE

  PHONE
  

  
  XXX-XXX-

  EMAIL
  

  
  [EMAIL PROTECTED]

 
  ITEM LEAD TIME (IN DAYS)
  
   
 






Exceptions in Struts code

2001-06-08 Thread Timothy Hicks

I just installed Struts 1.0b2 with Websphere 3.5.3 and had one major
problem.  If I do not put a try catch in the FormTag.doEndTag() I receive
an uncaught exception.

I modified the method FormTag.doEndTag() to the following to catch the
exceptions I was receiving from the removeAttribute() calls.  What am I
doing wrong that I have to modify a class which I would think has been
pounded on for some time?

public int doEndTag() throws JspException {
try
{
// Remove the page scope attributes we created
pageContext.removeAttribute(Constants.BEAN_KEY,
PageContext.REQUEST_SCOPE);
pageContext.removeAttribute(Constants.FORM_KEY,
PageContext.REQUEST_SCOPE);
}
catch (Exception e)
{
 System.out.println("Exception caught : " + e.toString());
}

// Render a tag representing the end of our current form
StringBuffer results = new StringBuffer("");

// Render JavaScript to set the input focus if required
if (focus != null) {
String tempFocus = focus;
StringBuffer refocus = new StringBuffer("[");
if (tempFocus.indexOf("[") > 0) {
StringTokenizer st = new StringTokenizer(tempFocus, "[");
if (st.countTokens() == 2) {
tempFocus = st.nextToken();
refocus.append(st.nextToken());
}
}
results.append("\r\n");
results.append("\r\n");
results.append("  \r\n");
results.append("\r\n");
}

// Print this value to our output writer
JspWriter writer = pageContext.getOut();
try {
writer.print(results.toString());
} catch (IOException e) {
throw new JspException(messages.getMessage("common.io", e.toString
()));
}

// Continue processing this page
return (EVAL_PAGE);

}




action include and action forward

2001-05-14 Thread Timothy Eifert

I have a need to use includes as well as forwards in my struts based
application.

While I have inherited off the action servlet to facilitate this - I'm
looking for a way to represent it in the struts-config.xml file.

Has anyone implemented a solution to this?

- Tim



custom classloaders and web-apps

2000-10-19 Thread Julien, Timothy

Suppose i have a custom classloader for my web-app.
The basic problem I can't seem to resolve is:
1. A servlet in the web-app loads a ResourceBundle:
ResourceBundle rb = ResourceBundle.getBundle("MyResources", locale);

Now, the ResoureBundle class will be loaded from the bootstrap classloader,
because the custom  (web-app specific)classloader looks there first.

2. The ResourceBundle getBundle() method looks for
"MyResources+locale.toString()" (or something very similar) in the
classpath.  Now, because ResourceBundle was loaded from the bootstrap
classloader, the class loader that is used to locate
"MyResources_local.toString()" is the bootstap one - which does NOT have the
class (or properties file) - THAT is app-specific.

So custom resource bundles won't be found.

Does anyone now how to get around this basic problem of child classloaders
somehow 'getting control' back, once a class has been loaded from the parent
classloader?

-Tim Julien