JSTL formatNumber and Locale

2006-04-21 Thread Tremal Naik
Hello,
I use the following syntax into a jsp page:

fmt_rt:formatNumber groupingUsed=true var=minInc scope=page
minFractionDigits=1 maxFractionDigits=1
value=${scenarioForm.minIncome}/
nested:text property=minIncome value=${minInc} /

The minIncome is initially defined into the scenarioForm as something
similar to an ordinary double, i.e. 2.0

The double is displayed into the minIncome text field as 2,0
accordingly to my regional settings. Ok

When the action defined for this form is executed the form minIncome
property value is converted to a numeric format. Ok

But... when I submit the form the validate() method is executed. If it
returns some errors, the request is redirected to the original page
before any regional-to-numeric conversion is performed, so now the
formatNumber tag doesn't like the format of the minIncome property:

2006-04-19 09:29:45,967 [http-0.0.0.0-8080-1] ERROR [ROM] [USER:
tremal] javax.servlet.jsp.JspException: In lt;formatNumbergt;, value
attribute can not be parsed into java.lang.Number: 2,0

How can I solve this? I would immediately convert the value in the
scenarioForm.setMinincome() method, if the http request object was
somehow available, as this method is called before the validate().
Infact, I need to know the user Locale to parse the string to a number
correctly (do I?). I may convert the value in the validate() itself
before proceeding with the validations, but I don't like this
solution, as it's advised against performing other than simple
validation in that. I may define an additional form field with the
user locale read from the request, but I'd rather use a smarter
solution.

Any suggestions?

--
TREMALNAIK

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



Re: Can struts do it?

2006-04-21 Thread Tremal Naik
2006/4/21, Marco Mistroni [EMAIL PROTECTED]:
 I have a DynaActionForm.  It has two array fields (String[] ownerRef and
 Boolean[] suspendPart) and some other fields.  I want to populate these
 arrays from a form and be able to submit the value from the page.
  That's it.

why don't you define an array of beans, each of which containing two properties:

class myBean{

}
--
TREMALNAIK

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



Re: Can struts do it?

2006-04-21 Thread Tremal Naik
2006/4/21, Marco Mistroni [EMAIL PROTECTED]:
 I have a DynaActionForm.  It has two array fields (String[] ownerRef and
 Boolean[] suspendPart) and some other fields.  I want to populate these
 arrays from a form and be able to submit the value from the page.
  That's it.

why don't you define a bean, each of which containing two properties:

class myBean{
 String ownerRef;
 Boolean suspendPart;
// getters and setters ...
}

Than you may add an array property to your form:

myBean[] simpleIterate

Iterating through this array, reading and setting properties would be
much easier.

In your business logic then, you may populate the original arrays
--
TREMALNAIK

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



Re: Shale documentation

2005-12-08 Thread Tremal Naik
2005/12/7, Gary VanMatre [EMAIL PROTECTED]:
 I'm planning on some Shale white papers that will be available on my 
 employers website (so I can get paid for doing it and promote services :-).   
 Please feel free to ask questions here about Shale.

thanks to you

--
TREMALNAIK

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



Re: http proxy

2005-12-08 Thread Tremal Naik
2005/12/8, Nicolas De Loof [EMAIL PROTECTED]:
 Do you know any opensource (java) proxy that could help me doing this ?

i've used muffin for a while:

http://muffin.doit.org/

I used it for much simpler tasks then those you need, but I see it's
very flexible and maybe it gives you what you need


--
TREMALNAIK

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



Re: sslext

2005-12-08 Thread Tremal Naik
2005/12/6, Jim Reynolds [EMAIL PROTECTED]:
 If I put a object into the request, and switched protocols, the
 request object was no longer found? Since most struts work has

I see that when sslext switches from a protocol to another what is
really happening is: a redirect is sent in the response to the user.
So the client performs another request with the swapped protocol. So:

1-The client send a request with the first protocol
2-The server send a redirect to the client
3-The client sends a new request with the second protocol

The original request is lost in 2, so if you put something in the
request before 2, that may be lost as well. I said 'may' because, if I
remeber well, sslext itself saves the request object in the session
and when the new user request arrives restores the old request
appending it as a query string on the new one. This is a behaviour not
always good if you are coming out from a secure page (as may be the
case when you perform a login) because I noticed that sometimes,
exiting from a secure login session, you can see the username and
password in the browser url. I resolve it with an addictional redirect
(using a JSP forwarding to another, but there are many ways) to clean
the request query string before leaving a secure channel.

Even if sometimes the usage of sslext is a bit tricky, I think it
works well for many things and I use it in my commercial applications.

--
TREMALNAIK

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



nesting radio buttons

2005-10-04 Thread Tremal Naik
Hello,
I'm trying to render a questionnaire on a page using radio buttons.
The questionnaire is built as a list of questions, each with some
answers the user may check using radio buttons.

input type=radio name=question1 value=1
input type=radio name=question1 value=2
input type=radio name=question1 value=3
.
input type=radio name=question2 value=1
input type=radio name=question2 value=2
input type=radio name=question2 value=3

My form has an ArryList property, populated with QuestionBean beans
which have a property that is an ArrayList of AnswerBean beans. I'm
trying to populate the page with a sintax of the form:

nested:iterate property=questions
  nested:message property=questionLabel/
 ...
  nested:iterate property=answers
  html:radio idName=answers value=value property=question /
  /nested:iterate
/nested:iterate

I was not able to find the correct syntax. If i ue the html:radio
tag I'm not able to set an indexed radio name, if I use the
nested:radio / I'm not able to set a value for the 'value' attribute
other than a costant. How did you solve this problem?

Any hint would be appreciated

thanks,

--
TREMALNAIK

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



Re: nesting radio buttons

2005-10-04 Thread Tremal Naik
2005/10/4, Tremal Naik [EMAIL PROTECTED]:
 Hello,
 I'm trying to render a questionnaire on a page using radio buttons.

I'm using Struts 1.1


--
TREMALNAIK

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



Re: struts on jboss

2005-09-16 Thread Tremal Naik
2005/9/16, mlists [EMAIL PROTECTED]:
 Is this an configuration-issue? (It's not very comfortable to restart the
 server everytime after a change).

what version of Jboss? 
And what the message you are receiving? 
Is your application composed by either a WAR and a JAR? 
If that is the case, do you deploy class duplicates in the two files?

-- 
TREMALNAIK

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



Forwarding to the previous page

2005-09-07 Thread Tremal Naik
Hi, I have a menu on my application, which is tiled in all the pages.
I have an action of the menu which is common to all the page in which
I am, so the execute() method of the action class associated to it
must return a forward to the page which called it. I know how to map
the  forward of an action to a specific, struts-config hard-coded
page.

How can I deal with this kind of dynamic forwarding? Id est forwarding
the action to the page which called it?

Thanks

-- 
TREMALNAIK

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



Re: Forwarding to the previous page

2005-09-07 Thread Tremal Naik
2005/9/7, Duane Rosengartner [EMAIL PROTECTED]:
 This works very well for me.
 
  a class=button href=javascript:history.back()Back/a

aehm,probabily I didn't explain well my problem: I don't have to get
back to the previous page from the actual. Look at this code:

public class DisplayAboutAction extends Action
{
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse)
{
// do stuff.
ActionForward af = new ActionForward();
af.setPath(previousPagePath);
return af;
}
}

I need to get a value for 'previousPagePath'. 

I'm trying something like :

bean:page id=reqq property=request /
html:link action=next.do paramId=old_page paramName=reqq
paramProperty=servletPath

but I'm using Tiles, so what I have as 'old_page' parameter is not the
action 'previous.do' but '/jsplayout.jsp' instead

thanks,

TREMALNAIK

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



Re: Forwarding to the previous page

2005-09-07 Thread Tremal Naik
2005/9/7, Frank W. Zammetti [EMAIL PROTECTED]:
 I don't think there's anything inherently in Struts to do that, however,
 it shouldn't be too hard to do on your own... how about this right before
 you return your ActionForward from ANY Action:
 
 session.setAttribute(previousPage, mapping.getPath());
 

I was thinking of a navigation bean to store in the user session, but
is that 'modifying ANY action' that I was trying to get rid of.

thanks

-- 
TREMALNAIK

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



Re: logout problem

2005-09-05 Thread Tremal Naik
2005/9/5, Adam Hardy [EMAIL PROTECTED]:
 Fourthly I think the work involved in making something track all
 sessions like this and then inactivate any that stop would be
 considerable. At least I can't think of a suitable algorithm off the top
 of my head.

I had the same problem: avoiding duplicate user login and at the same
time giving the user the possibility to log again in case of
browser/network failure without waiting cache/session timeout. I
solved redirecting the user to a new login page, if she tries to
relogin while a session is still alive. So it's up user responsability
deciding to force out the old session. She should know if he's kicking
out his boss ;)

-- 
TREMALNAIK

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



Re: showing nested collections in a JSP

2005-08-18 Thread Tremal Naik
2005/8/17, [EMAIL PROTECTED] [EMAIL PROTECTED]:
 I think I can figure out how to display the tables using the nested:XX tags,
 but cant figure out how to display the nested collection by radio button. I
 guess I need to understand how to index a collection dynamiclly.  I know
 JSTL is the preferred way, but I'm stuck with only the struts tags to build

Don't know if I undeerstood well your need, but I would use client
logic, as javascript functions, to realize this behaviour. Why don't
make use of the 'style' property of visual elements to hide/display
them depending on radio button clicking events?

-- 
TREMALNAIK

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



how to include a jsp into another

2005-08-10 Thread Tremal Naik
hello, I'm trying to realize the jsp:include functionality throught
pure Struts tags.

I  included in my JSP the following:

bean:include  id=report page=/otherPage.jsp

when I display it within a scriptlet:

%=report%

the page is rendered as expected, but when I try to display it with 

bean:write name=report /

I don't see the content of the otherPage ,but the html code of it. 

I don't want to use scriplets to display the included page, just tags.

Can you help me?
-- 
TREMALNAIK

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



Re: how to include a jsp into another

2005-08-10 Thread Tremal Naik
2005/8/10, Gareth Evans [EMAIL PROTECTED]:
 bean:write name=report filter=false /

so easy that I didn't noticed in the documentation ;)
thanks!

-- 
TREMALNAIK

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



Re: retrieving exception from page context using tags

2005-08-03 Thread Tremal Naik
2005/8/3, Laurie Harper [EMAIL PROTECTED]:
 Huh? From the documentation: page - Expose a specified item from the page
 context as a bean.

yes, I saw it, if you read deeply my post you'd notice it, but the
bean:page lets me retrieving only some objects, not the exception.

I need some tag which let me retrieve the page context, I found
something on the jakarta taglibs, I have to experiment. Thanks, anyway

-- 
TREMALNAIK

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