Re: i18n and same value for 2 different locale

2005-10-24 Thread Jurn Ho

I'd be very interested if you find out what is wrong..
We have a similar issue that only appears sometimes to our webapp 
when its deployed to a websphere server. Our other environments that 
run tomcat have never exhibited this problem.


Jurn

At 07:52 AM 22/10/2005, Christian Bourque wrote:

Hi!

I got a weird problem with my application (only in production), the
problem is intermittent and I wasn't able to reproduce it yet.

Sometimes the messages returned by bean:message aren't correct
(english when it should be french and vice versa). I did a test in a
jsp for a specific key and the value returned was in english for a
french locale ??? What is weird is that it doesn't apply to all
messages on the page, some messages are in french and the others in
english ??? It's like at some point the Struts messages cache got
corrupted...

I have two properties file :

- application.properties (default french)
- application_en.properties (english)

A default locale is set in my init servlet :

Locale.setDefault(Locale.FRENCH);

I never experienced the same behaviour on my development workstation
(XP), the production server runs Linux (SUSE)...

I reloaded the properties files live on the production with this code
in a jsp (ugly hack) :

MessageResourcesFactory factory =MessageResourcesFactory.createFactory();
MessageResources resources =factory.createResources(resources.application);
application.setAttribute(org.apache.struts.action.MESSAGE, resources);

And everything went back to normal (until next time)...

I would appreciate any suggestions!

Regards,

Christian


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



Re: link with img and request attribute

2005-08-19 Thread Jurn Ho

replace text 'add' with
img src=addbutton.gif/
or a struts html:img

You may also want to change your a href into a html:link.

cya,
Jurn

At 01:33 AM 19/08/2005, =?ISO-8859-2?Q?S=B3awek_Tuleja?= wrote:

Hi EveryBody

i have problem with this:

1) i have:

a href=PreAddComment.do?idUser=bean:write name=user 
property=idUser /add/a


2) and it works fine, but i want to put image button insted of link add



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



Re: How to write logic:iterate for the Collection of HashMap.

2005-08-19 Thread Jurn Ho

Hi Amol,

please see http://struts.apache.org/userGuide/struts-logic.html
especially the section on maps.

logic:iterate id=element name=myhashtable
Next element is bean:write name=element property=value/
with key bean:write name=element property=key/
/logic:iterate

Jurn

At 10:06 PM 18/08/2005, Amol Yadwadkar wrote:



Hello List,

I need to display the results stored in the Hashmap.

How can I achieve it by using logic:iterate  

I know the way to do it for List type data.

Can anyone help me in this ?

Thankx n regds,

Amol



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



Re: Need help using tiles taglib with JSTL

2005-08-19 Thread Jurn Ho
nested within the tiles:insert, I think you want a tiles:put instead 
of a useAttribute?


Jurn

At 01:59 AM 19/08/2005, Michael Mattox wrote:

I'm trying to use the tiles taglib with JSTL (servlet spec 2.4).. if I use
just the HTML tags they work file, and JSTL 1.1 by itself works fine. The
problem comes when I need to use them together.  Here I have a list of
inscriptions in the request scope and I want to loop through them and pass
each one to a tile to display each one (individually).  I can't figure out
the way to call the tiles:useAttribute tag:

c:forEach items=${listeInscriptions.inscriptions} var=inscription

  tiles:insert name=web-inscription flush=true
tiles:useAttribute id=${inscription}
classname=fr.data.Inscription
name=inscription
scope=request
ignore=false/
  /tiles:insert

/c:forEach

I'd be grateful for a bit of help with this.  I've tried asking about
mixing struts tags  JSTL in the past week but haven't had a concrete
example like this and now I'm really stuck. :)

-Michael



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



Re: code snippet for html:optionCollection

2004-09-02 Thread Jurn Ho
Hi Viji,
I was just playing with that today. Here's my code snippets that should 
help you.

From inside my extended Action class
...execute(...) {
List businesses = getUserService().getBusinesses();  // go lookup 
database and list all the businesses.
request.setAttribute(businesses, businesses);  // save it in the 
request so the jsp can access it later.
return mapping.findForward(Success);
}

the List named 'businesses' is actually an ArrayList of BusinessView, which 
is a javabean with the following interesting fields
1. long id
2. String name;

and then, from inside my jsp
tr
  tdBusiness owner/td
  td
html:select property=owner
  html:optionsCollection name=businesses
  label=name
  value=id/
/html:select
  /td
/tr
checkout http://struts.apache.org/userGuide/struts-html.html#select
and http://struts.apache.org/userGuide/struts-html.html#optionsCollection
for more info.
Does combobox mean you can select mutliple entries? if so you can probably 
add multiple=true attribute to the html:select element.

cya,
Jurn
At 02:37 PM 3/09/2004, viji.george wrote:
can anybody send me a code sample for using html:optionCollection for 
getting the value from the ArrayList and populating the combo box.

I am storing the values retrieved from the DB in a arraylist in the form 
of a class which has 2 attributes one for option value and the other for 
text of the option.

I want to put these values into the combo box.
has anybody done this?
Viji George
Information Systems,
The Arvind Mills Ltd.,
Naroda, Ahmedabad.
Phone-(079)22203030
Ext -2352
mailto:[EMAIL PROTECTED][EMAIL PROTECTED]

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


Re: Module and pages Behind WEB-INF don't work...???

2004-07-29 Thread Jurn Ho
Hi Puneet,
I was just playing with hiding JSP beneath WEB-INF/ and Modules today.
What you can do is edit your struts-module-config.xml
and as part of the controller you can add the forwardPattern property
e.g. My setup is  set-property property=forwardPattern 
value=/WEB-INF/jsp$M$P/, so that my forward paths don't contain the 
WEB-INF/jsp

read section 5.2.1 at http://struts.apache.org/userGuide/configuration.html
$M is module, and $P is path
By default it is $M$P like you have found out, but you're probably after $P.
I think you might need to add this to each struts module config.xml that 
you do. Does anyone know if you can set default controller properties for 
all modules-config.xml?

cya,
Jurn
At 04:48 PM 29/07/2004, [EMAIL PROTECTED] wrote:
I want to do both hide my JSPs behind WEB-INF and use Struts modules.
and this does not work, I looked into the struts code. it does the following
If the path of ActionForward starts with /, it obtains the module prefix 
and prefixes this to the path so...
If my path was say /WEB-INF/pages/INY0010S.jsp it becomes 
/iny/WEB-INF/pages/INY0010S.jsp
( which is unwanted..I wanted.../WEB-INF/pages/INY0010S.jsp )

but if the path of ActionForward does not start with /, it leaves the 
path as it is ( i.e. does not prefix the module-prefix)
but then the requested URI becomes like this

http://ipaddress:port/web-context-rootActionForward-path
instead of
http://ipaddress:port/web-context-root/ActionForward-path
so the problem is there is no slash - / before ActionForward-path
so if my path was WEB-INF/pages/INY0010S.jsp it searches for 
http://ipaddress:port/web-context-rootWEB-INF/pages/INY0010S.jsp
which gives error...Can anyone suggest the way out..?

or does this require a fix ? only a Quick resolution of this will be able 
help.

Regards,
Puneet Agarwal
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.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]


is an action path attribute with periods ok?

2004-07-28 Thread Jurn Ho
Hi Everyone,
I've been experimenting with Struts, and have got up to the stage where I'm 
using the 'html' taglib to create a link to my action classes, but when 
I've got periods in my action paths it doesn't seem to create the correct url
e.g.

in my test.jsp:
html:link action=/a.b.ca b c test link/html:link
in my web.xml the servlet mapping is *.do
and in my struts-config.xml:
action path=/a.b.c
type=com.magicmonster.test.UserAction
  forward name=Success path=/WEB-INF/admin/user_list.jsp 
redirect=false/
/action

when I see my created page, it has
a href=a.b.doa b c test link/a
but I expected
a href=a.b.c.doa b c test link/a
Has anyone experienced this problem before..?
maybe it has something with *.do servlet mapping?
The reason I had a.b.c was to separate different sections of my application,
If I replace the periods in the action path attribute with '/',  then it 
works as expected.
I might try Modules as this seems to be proper way to do it.

any feedback/suggestions are welcome,
thanks,
Jurn

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