How to escape {1} that it appears in the text?

2004-09-26 Thread Axel Seinsche
Hi all,
How can I escape curly brackets in my message bundle so that I can 
display {1} in my JSP? I already tried with \ or \\ but whenever I don't 
receive an error {1} is replaced by 'null' in the text. Hope someone can 
help me.

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


How to iterate forEach in reverse order?

2004-09-05 Thread Axel Seinsche
Hi all,
I have a forEach loop which iterates from startValue to endValue, which 
works fine. But forEach wants me that startValue is smaller than 
endValue. If I want to iterate from a bigger value down to a smaller 
it's not possible. I tried to switch start and end value but without 
success. Even to set a step of '-1' didn't help. Is it possible to 
iterate from a bigger value down to a smaller value?

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


Re: Error loading Applet in IE within Struts application (fixed)

2004-08-22 Thread Axel Seinsche
The problem seems to be fixed. The codebase was missing. Firefox and 
Mozilla didn't care about, but IE. Nevertheless the applet runs if it is 
executed on the same server but outside the Struts application.

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


Error loading Applet in IE within Struts application

2004-08-21 Thread Axel Seinsche
Hi,

this question not typically Struts related, but maybe someone on this list had this 
error before and can help me. I have an applet which runs well on Firefox and Nescape. 
Evevn if I put in a single HTML file it is loaded correctly with Internet Explorer. As 
soon as the applet is integrated in my Struts application it is NOT loaded with 
Internet Explorer. An IOException HTTP Connection failed occurs. With Firefox and 
Netscape the applet is loaded correctly inside my Struts application. No problems. As 
most of the users do use Internet Explorer I can't ignore this problem.

All solutions I found so far with google don't match for me (or don't seem to match 
like problems with upper and lower case charcacters).

- IE Version is 6.0.2800 on Windows XP SP1
- JDK / JRE to execute the applet I tried JSDK 1.4.2 [04|05]

TIA,

Axel

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

Re: Uploading files to a database

2004-08-20 Thread Axel Seinsche
Ivan Vasquez schrieb:
Hi,
What's the preferred way to upload files into a database in a J2EE Web
application? 

Is there any way to stream the file straight from the HttpServletRequest
to the database without staging it in the server's filesystem? 

Thank you,
Ivan.
 

That's how I use it. But in my case I want to store a file on the 
server. But it should be easily possible to put the Stream to CLOB or 
something like this.

streamIn = file.getInputStream();
streamOut = new FileOutputStream(fileName);
int bytesRead = 0;
byte[] buffer = new byte[8192];
while ((bytesRead = streamIn.read(buffer, 0, 8192)) != -1) {
 streamOut.write(buffer, 0, bytesRead);
}
streamOut.close();
streamIn.close();
file.destroy();
file is a FormFile object which you can use with Struts with the 
 tag.

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


Re: errors get lost on redirect

2004-08-20 Thread Axel Seinsche
Hubert Rabago schrieb:
Well, not really set the input, but you can direct the request to the
correct one in your java code.
First off, set validate=false on the action.  
Then, in your action, call the form's validate() yourself.
Lastly, if there are validation errors, call saveErrors() to save the
error messages then forward the request to the correct input form.

Hubert
 

Thank you Hubert, sometimes the best solution is so near and you can't 
see it. ;-) This works perfectly and was the fastest way to realize this.

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


Re: errors get lost on redirect

2004-08-20 Thread Axel Seinsche
Bill Siggelkow schrieb:
I don't understand exactly why you are doing the redirect? Why not 
just set the input attribute to be the page you are redirecting to ... 
then Struts will forward to it when validation fails.

Can I set the input attribute in my Java Code? I thought I have to 
define it in the struts-config.xml. But at design time it's not yet 
defined to which page the application should forward to. Is it possible 
to use mapping.setInput(myForward)? That would be too easy. ;-)

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


errors get lost on redirect

2004-08-20 Thread Axel Seinsche
Hi all,

in my struts application I have 4 forms which have to be filled to store an item in 
the database. All 4 forms are inherited from one abstract form class. As form 3 
depends on data from 1 I didn't find a better solution, but it works.

The problem is the following. When I submit form 4 I can do the complete validation. 
The ActionErrors are filled correctly, but I return back to Form 4 (of course). I then 
did a  and inside a redirect to page where the error is. The 
redirect works fine, but the errors get lost on this redirect. Can I somehow preserve 
my errors when redirecting or can I do this without a redirect. As the ActionClass 
isn't called I can't call a mapping.findForward() or something like this. I tried to 
put the errors object in the request scope before doing the redirect but it's not 
stored - even the session scope didn't work. But that was just a try, I don't want my 
errors to be in the session scope. I hope someone can enlighten me. :-)

Regards,

Axel

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

Re: validation for optional fields

2004-06-11 Thread Axel Seinsche
Kalra, Ashwani wrote:
hi,
how can I validate an optional field. ie validate only if there is some
value in it. For example. I want to validate a field which should of type
int.But  it should be validated only if use has entered some value in it.
 

hi,
if you are validating in your form or action class you can check if the 
field is not empty (!= null or !equals("") and then check for correct 
int value.

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


Re: How to avoid character encoding for html tags

2004-06-11 Thread Axel Seinsche
Václavík Radek wrote:
Hi Axel, 

don't know if I understood your problem well, but i have such text in db and
when printing it in jsp using  i use this parameter:

Hope this helps.
 

Hi Radek,
thanks your very much. As I used 

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


How to avoid character encoding for html tags

2004-06-11 Thread Axel Seinsche
Hi all,
I have an application where the user should be allowed to use text 
formatting tags as  or  (and so on). To avoid that tags like 
 oder  (and so on) are used I check the for these tags 
before it's stored in the DB.

When the text is read from the DB my tags are encoded to . How 
can this be avoided? It's indeed a nice feature, but I don't like this 
right now. ;-)

Hope someone can give me a hint.
Thanks,
Axel
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


getting a random number with JSTL?

Hi all,
I know this is not a JSTL list, but maybe someone can tell me, if there 
is a possibilty to get a random number with a JSTL tag. Best would be to 
have min and a max value. If this doesn't exist, I think about wrtiting 
such a tag for me. But I don't have to do this, if it still exists. ;-)

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


Re: Best way to connect to Database in struts

Zaid wrote:
Dear Friends,
I am new to struts, so I was confused in choosing the best way to make
connection to Database, whether data-resources or Plugin or any other
method, however, if any suggested way to connect, please inform me. Baring
in mind that I am using MySQL server.
 

As the Struts data-sources did not work for me, I used JNDI to access my 
DB. This works very well. I somewhere read, that the Struts data-sources 
are not developed any longer and the suggest to use JNDI. I don't know, 
if this is true. But it could be possible.

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


[JSTL] accessing rows by index

Hi all,
in my Struts application I can access result collection from sql:query 
with the forEach loop. When I try access one single row by index, it 
fails. Right now I solved this with defining a forEach loop where begin 
and end are the index I want to access.

This looks like this:

   ...

In my opinion there should be an easier way. Can anyone give me a hint 
or a piece of code how I have to access my rows by index?

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


Re: Multiple validation.xml

Linus Nikander wrote:
Is it possible to use multiple validation.xml files concurrently ? We're
about to launch a fairly large projetct and I see issues where one developer
has validation.xml checked out when another one needs to edit it as a
possible problem.
//Linus Nikander -
 

If you use CVS it should be no problem to have file which is edited by 
two persons at one time. As XML files are text-only files CVS can do 
merges. We are using this for our projects too and don't have any 
difficulties. I don't think it's a good alternative that you will create 
several XML files.

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


Re: From bean into "for" loop

Andy Engle wrote:
Hi all,
I am trying to do something as simple as writing a FOR loop with some
information that I have in a bean, but this is proving to be quite a
bit more cumbersome and difficult than I thought it would be.  For some
reason, everything I try seems to fail.  Here is a short example of
what I'm trying to do:
<% for(int i = 0; i < ${productData.someCount}; i++) {  %>
  // Write my text here
<% } %>
What am I missing here?  If you could help me I'd appreciate it --
enough time wasted on this thing already.
 

I think you can solve this with a forEach loop from JSTL. Using EL it 
should be quite easy. When I am back home this evening I can send you an 
example if you need it.

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


i18n with keys from DB

Hi all,

I think I have a common problem, but couldn't find any solution in the archive of this 
list or with Google.

All I want to have is i18n where keys come from the DB. My DB contains a table where I 
can read the keys from. With this key I want to do a lookup in my properties file. How 
can I do this? Until now I failed to something like

" />

I hope this problem was solved before and someone can help me.

I thougt about storing my values language dependent in the DB, but for several reasons 
I don't like this approach! 

Thanks,

Axel

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