RE: getText

2011-03-30 Thread Jose Luis Martinez Avial
You can setup a locale in the session and Struts will use that for all
your texts. 

-Original Message-
From: franc...@rendezvouscentral.com
[mailto:franc...@rendezvouscentral.com] 
Sent: Tuesday, March 29, 2011 6:26 PM
To: user@struts.apache.org
Subject: getText

Hi Everybody
is there a way to use getText in an action and specify the locale (I
mean , I don't want struts to use the getLocale() from the browser) ?

something like that getText('my.ref',myLocale);

thx a lot

--
View this message in context:
http://struts.1045723.n5.nabble.com/getText-tp4270294p4270294.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Pluto embedded in Strstu 2.1.8.1

2011-03-16 Thread Jose Luis Martinez Avial
Hi,
I'm looking how I can integrate an external application available
through WSRP with our in-house webapp developed with Struts. I would
like to check how I can embed Pluto in Struts2. Has anyone tried that?
Is there any documentation or example available?
 
TIA
 
JL


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

RE: loading Dropdown dynamically from database

2011-03-14 Thread Jose Luis Martinez Avial
Can you put the chunck of your struts.xml in which the action is
defined?

-Original Message-
From: JavaNoobie87 [mailto:vivek...@enzentech.com] 
Sent: Monday, March 14, 2011 2:59 AM
To: user@struts.apache.org
Subject: RE: loading Dropdown dynamically from database

Yes there is a method doing that.Here is the snippet .
public void setDtList(List dtList) {
this.dtList = dtList;
}

public List getDtList() {
return dtList;
}

Ive also uploaded the entire action class. 
http://struts.1045723.n5.nabble.com/file/n3555946/DomainAction1.txt
DomainAction1.txt  

--
View this message in context:
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-da
tabase-tp3555885p3555946.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: struts 2 internationalization problem

2011-03-14 Thread Jose Luis Martinez Avial
It should work right away with that. Check after settint the locale if
is correct using :

Locale locale = ActionContext.getContext().getLocale();

That should return the same locale you selected.

-Original Message-
From: sumitjain23 [mailto:sumitjai...@gmail.com] 
Sent: Monday, March 14, 2011 2:20 AM
To: user@struts.apache.org
Subject: Re: struts 2 internationalization problem

Tried with a locale but still not working

--
View this message in context:
http://struts.1045723.n5.nabble.com/struts-2-internationalization-proble
m-tp388p3555928.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: loading Dropdown dynamically from database

2011-03-13 Thread Jose Luis Martinez Avial
Is there a public List getDtList in the Action? You didn't put it in the
code.

-Original Message-
From: JavaNoobie87 [mailto:vivek...@enzentech.com] 
Sent: Monday, March 14, 2011 12:57 AM
To: user@struts.apache.org
Subject: Re: loading Dropdown dynamically from database

The jsp corresponding to the dropdown didnt show up im attaching it to
the below file.
http://struts.1045723.n5.nabble.com/file/n3555886/jsp_snippet.txt
jsp_snippet.txt 

--
View this message in context:
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-da
tabase-tp3555885p3555886.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: struts 2 internationalization problem

2011-03-13 Thread Jose Luis Martinez Avial
Sorry, it slipped. It would be something like this
//
String country = 'FR"
String language = 'fr'
Locale locale = null;
If(country!=null && langauge !=null)
locale = new Locale(language ,country );
} 
else {
locale = Locale.US;
}

sessionAttributes.put(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE,
locale); 
 

-Original Message-----
From: Jose Luis Martinez Avial 
Sent: Monday, March 14, 2011 12:47 AM
To: 'Struts Users Mailing List'
Subject: RE: struts 2 internationalization problem

I usually do this

Locale locale = new Locale(tokens[0],tokens[1]);
} else {

if(!queries.isLocaleSupported(locale.toString())){
log.debug("Locale "+locale+" no
soportado. Lo sustituimos por US");
locale = Locale.US;
}
}
log.info("User Locale is "+locale);

sessionAttributes.put(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE,
locale); 

-Original Message-
From: sumitjain23 [mailto:sumitjai...@gmail.com]
Sent: Sunday, March 13, 2011 2:39 PM
To: user@struts.apache.org
Subject: struts 2 internationalization problem

I am developing struts 2.2 application. When I pass a request_locale
parameter from a web page then it works fine i.e. the locale changes.
But when I try to change it programatically by setting the session
parameter

session.setAttribute("WW_TRANS_I18N_LOCALE", "fr");

it does not work i.e. the locale does not change

Am I missing something. Please help me..


--
View this message in context:
http://struts.1045723.n5.nabble.com/struts-2-internationalization-proble
m-tp388p388.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: struts 2 internationalization problem

2011-03-13 Thread Jose Luis Martinez Avial
I usually do this

Locale locale = new Locale(tokens[0],tokens[1]);
} else {

if(!queries.isLocaleSupported(locale.toString())){
log.debug("Locale "+locale+" no
soportado. Lo sustituimos por US");
locale = Locale.US;
}
}
log.info("User Locale is "+locale);

sessionAttributes.put(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE,
locale); 

-Original Message-
From: sumitjain23 [mailto:sumitjai...@gmail.com] 
Sent: Sunday, March 13, 2011 2:39 PM
To: user@struts.apache.org
Subject: struts 2 internationalization problem

I am developing struts 2.2 application. When I pass a request_locale
parameter from a web page then it works fine i.e. the locale changes.
But when I try to change it programatically by setting the session
parameter

session.setAttribute("WW_TRANS_I18N_LOCALE", "fr");

it does not work i.e. the locale does not change

Am I missing something. Please help me..


--
View this message in context:
http://struts.1045723.n5.nabble.com/struts-2-internationalization-proble
m-tp388p388.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Code Help:CRUD example

2011-03-12 Thread Jose Luis Martinez Avial
I would check exactly where the NPE is happenning. According to your
code and stck trace it happens here:

public String listDomain(Integer dt_oid)
{
String result= SUCCESS;


try {
domList=DomainDAO.listDomain(dt_oid);
System.out.println("Listing domain");
return result;


} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
result=null;
return result;
}
} 

But since DomainDao.listDomain is static, there is nothing here that
would launch the NPE. I suggest to  put some traces in the code the
follow it and see what's happening.  But this has nothing to do with
Struts at all.

-Original Message-
From: JavaNoobie [mailto:vivek...@enzentech.com] 
Sent: Friday, March 11, 2011 7:12 AM
To: user@struts.apache.org
Subject: Re: Code Help:CRUD example


The Jsp file to the same is as follows.
http://old.nabble.com/file/p31124495/newjsp.txt newjsp.txt 

JavaNoobie wrote:
> 
> Hi All,
> This is in following to my previous message .
> I have developed a small CRUD example using struts 2 . But when I try 
> to run the same it throws an error (Null pointer exception).. The 
> exception stack trace is as follows.
> Inside AddDomain
> java.lang.NullPointerException
>   at
>
com.vivek.struts2.action.DomainAction1.listDomain(DomainAction1.java:92)
>   at
>
com.vivek.struts2.action.DomainAction1.addupDomain(DomainAction1.java:81
)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at
>
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActi
onInvocation.java:404)
> 
> Could anyone please guide me as to where Im going wrong . Im attaching

> the source code of my action , dao class , xml files ad jsp here
.Please help.
>  http://old.nabble.com/file/p31124479/DomainAction1.txt 
> DomainAction1.txt  http://old.nabble.com/file/p31124479/DomainDAO.txt 
> DomainDAO.txt http://old.nabble.com/file/p31124479/strutsxml.txt 
> strutsxml.txt
> 
> 

--
View this message in context:
http://old.nabble.com/Code-Help%3ACRUD-example-tp31124479p31124495.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Struts 2.0.11.1 question

2011-03-09 Thread Jose Luis Martinez Avial
May I ask why the struts-json plugin is not blessed? I've been using it
for months and works ok for me. I use json-result, the json interceptor
and JSONUtil.serialize without any issue. I'm using Strtus 2.1.8.1 

-Original Message-
From: Harsh C [mailto:hchau...@gmail.com] 
Sent: Tuesday, March 08, 2011 6:24 PM
To: Struts Users Mailing List
Subject: Struts 2.0.11.1 question

Hi,

I don't know if this is the right list for a question regarding
2.0.11.1, if not please let me know the right forum.

I am trying to use Struts 2.0.11.1 to work on an AJAX-ified app using
Dojo.
Problem is, struts-json plugin is not blessed.

Is there a way in which I can code an Action which returns a JSON string
without using the JSON plugin?

--
*Thanks,
Harsh*

Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Double Select Tag

2011-02-23 Thread Jose Luis Martinez Avial
I'm not proud at all of this code, I wrote it long long time ago, but it
works, so here it is. You need to create an action that receives a
parameter called valueSelected, get the values for the second select,
and returns them with the following aspect:


1
10


Code HTML


[load the first select]





Code Javascript

function getSecurities() {
  var select = document.getElementById("secondSelect ");
  while (select.length>1){
select.remove(1);
  }
  var valueSelected = document.getElementById("firstSelect").value;
  var url ="MyActionToGetValuesForSecondSelect.accion"
  var params = " valueSelected ="+ valueSelected +"&mySecondParameter="+
mySecondParameter
  updateAjaxSelect(url,params,"idSecurities")
 }

var browser = 'IE'
try {
if (XPathEvaluator) browser='FF'
}
catch(E){}

function updateAjaxSelect(url,params,idSelect){
var select = document.getElementById(idSelect);
  get(url,params,function(doc) {
if (browser=='FF') {
var oEvaluator = new XPathEvaluator();
var oResult =
oEvaluator.evaluate("OPTIONS/OPTION", doc, null,
XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
if (oResult != null) {
var oElement = oResult.iterateNext();
while(oElement) {
oElement = oResult.iterateNext();
var opt =
document.createElement("option");
//alert("oElement.text "+oElement.textContent
//alert("oElement.getAttribute('value')
"+oElement.getAttribute("value"))
 
opt.appendChild(document.createTextNode(oElement.textContent));
opt.value = oElement.getAttribute("value");
select.appendChild(opt);
//alert(oElement);
}
}
}
else {
var nodos = doc.selectNodes("OPTIONS/OPTION")
for (i=0;imailto:davelnew...@gmail.com] 
Sent: Tuesday, February 22, 2011 8:55 PM
To: Struts Users Mailing List
Cc: Jerson John; jlm...@gmail.com
Subject: Re: Double Select Tag

On Tue, Feb 22, 2011 at 8:50 PM, Jerson John wrote:
> Could u send me some sample code for it ...Appreciate ur help

I think probably searching for "ajax autocomplete" will bring up
hundreds of examples; I'd try that first.

Dave

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-Original Message-
From: Jerson John [mailto:jer...@cprvision.com] 
Sent: Tuesday, February 22, 2011 8:51 PM
To: 'Struts Users Mailing List'; jlm...@gmail.com
Subject: RE: Double Select Tag

Hi JL,
   Could u send me some sample code for it ...Appreciate ur help


Many Thanks and Regards,


-Original Message-
From: jlm...@gmail.com [mailto:jlm...@gmail.com] 
Sent: Tuesday, February 22, 2011 12:41 PM
To: Jerson John; 'Struts Users Mailing List'
Subject: Re: Double Select Tag

Not right now, but you will find plenty of them on dojo's web page. But
if
you are gonna use it only once, then I would suggest to implement it
manually, rather than start looking the dojo api(can be quite comples).

Actually, I got someplace an example of a select loaded dinamically
using
ajax directly. It's pretty simple, so you should be able wo work
something
out of it. I will look and send it tomorrow.
--Mensaje original--
De: Jerson John
Para: 'Struts Users Mailing List'
Para: Yo
Asunto: RE: Double Select Tag
Enviado: 21 Feb, 2011 23:29

Thanks a lot for this quick reply...I roughly understood what u mean by
ur
three option...For the third one using dojo...Can u please provide me
some
sample code for that...I will be a great help ...

Many Thanks and Regards,

Jerson

-Original Message-
From: jlm...@gmail.com [mailto:jlm...@gmail.com] 
Sent: Tuesday, February 22, 2011 12:19 PM
To: Struts Users Mailing List
Subject: Re: Double Select Tag

Well, there are diferent options for this:
1) Load all the posibles values of the second select into javascript
arrays
when loading the page, and the populate the second select using
javascript
once the user has made a selection in the first select
2) Once the user has selected an element in the first select, navigate
to
present the same page, but with the second select also loaded.
3) Use Ajax to populate dinamically the second select retrieving the
data
from the server once the users selects one element on the first select.

You can write the javascript yourself, or use a toolkit like Dojo to
abstract yourself of that.

Depending on the amount of data, and the likelihood of changes in it, I
would use options 1 or 3, but it's up to you.

JL
--Mensaje original--
De: Jerson John
Para: 'Struts Users Mailing List'
Responder a: Struts Users Mailing List
Asunto: Double Select Tag
Enviado: 21 Feb, 2011 22:50

Hi,
  Can some one help me on double

RE: JSON Property

2011-02-07 Thread Jose Luis Martinez Avial
never mind, it can be avoided with the attribte escapeXml='false' in the tag.

-Original Message-----
From: Jose Luis Martinez Avial 
Sent: Monday, February 07, 2011 2:43 PM
To: 'Struts Users Mailing List'
Subject: RE: JSON Property

Question, the tag is writing the quotes as ", so I'm getting something 
like this:

var distributionListContent = 
{"identifier":"idDistributionList","items":[{"dateCreated":"2011-01-08T15:38:25","distributionListName":"EDP\/SPR","idDistributionList":"3"}],"label":null};

How can I avoid that?

-Original Message-
From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
Sent: Monday, February 07, 2011 1:15 PM
To: Struts Users Mailing List
Subject: Re: JSON Property

The right url should be http://java.sun.com/jsp/jstl/core,
http://java.sun.com/jstl/core is the old one.

Did you include the jstl library?

On 7 February 2011 19:12, Biesbrock, Kevin  wrote:
> Excuse me, I Google searched "jstl taglib"...
>
>
> Beez
> r 5347
>
> -Original Message-
> From: Jose Luis Martinez Avial [mailto:jlmarti...@pb-santander.com]
> Sent: Monday, February 07, 2011 12:56 PM
> To: Struts Users Mailing List
> Subject: RE: JSON Property
>
> Hello,
> I'm trying to use this combination of tags to convert to JSON, but it seems I 
> have some problems with the TLD. I'm getting the following error:
>
> manageDocuments.jsp:2:5: No tag library could be found with this URI. 
> Possible causes could be that the URI is incorrect, or that there were errors 
> during parsing of the .tld file.
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
>
> Which is the correct url? and I suppouse I need the jar that implements the 
> tags, right?where can I find the it?
>
> Thanks
>
> Jose Luis
>
> -Original Message-
> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
> Sent: Thursday, January 06, 2011 11:51 AM
> To: Struts Users Mailing List
> Subject: Re: JSON Property
>
> Try
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
>
> 2011/1/6 Jim Talbut :
>> Ah, sort of.
>> Actually WW-3554 stopped me working that one out :)
>>
>> Now I've moved the JsonPlugin.tld to my own WEB-INF I can make it work, but 
>> not using the syntax you used.
>>
>> If I have:
>> <%@taglib prefix="json" uri="/struts-json-tags" %> <%@taglib 
>> prefix="c" uri="http://java.sun.com/jstl/core"; %> > value="${json:serialize(orderLines)}"/>
>>
>> I get: PWC6236: According to TLD or attribute directive in tag file, 
>> attribute value does not accept any expressions
>>
>> But if I just put ${json:serialize(orderLines)} on its own it does output 
>> the JSON.
>>
>> I'm new to JSTL, do I have to do something in order to use an OGNL-based 
>> expression with c:out?
>>
>>
>> Thanks
>>
>> Jim
>>
>> -Original Message-
>> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
>> Sent: 05 January 2011 19:23
>> To: Struts Users Mailing List
>> Subject: Re: JSON Property
>>
>> Did this answer your question?
>> https://issues.apache.org/jira/browse/WW-3553
>>
>> 2011/1/5 Chris Pratt :
>>> I'm not sure how to make it work, but it would totally rock if we 
>>> could make the "encode" attribute of the  tag extensible by 
>>> plug-in's.
>>> That way the standard tag could possibly supply encode="html" & encode="js"
>>> and the JSON plug-in could add encode="json" and other plug-ins 
>>> could extend it in ways they need.  Just a wild thought.
>>>  (*Chris*)
>>>
>>> On Wed, Jan 5, 2011 at 1:22 AM, Steven Yang  wrote:
>>>
>>>> I think its "bundled" with S2 but as a separate jar, so dont get mistaken.
>>>>
>>>> i am a bit reluctant to share my code, which is old and bad, not 
>>>> that because i am cheap or anything, its because there are better 
>>>> and well-thought code out there (as in JSON plug in) and my code 
>>>> has lots of things tied to my project (bad design..).
>>>>
>>>> and you know what i just checked back on my tag code. I dont think 
>>>> i am doing anything much different from what your doing. I siimply 
>>>> copied the s:property tag code and replaced the output part of the code.
>>>

RE: JSON Property

2011-02-07 Thread Jose Luis Martinez Avial
Question, the tag is writing the quotes as ", so I'm getting something 
like this:

var distributionListContent = 
{"identifier":"idDistributionList","items":[{"dateCreated":"2011-01-08T15:38:25","distributionListName":"EDP\/SPR","idDistributionList":"3"}],"label":null};

How can I avoid that?

-Original Message-
From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com] 
Sent: Monday, February 07, 2011 1:15 PM
To: Struts Users Mailing List
Subject: Re: JSON Property

The right url should be http://java.sun.com/jsp/jstl/core,
http://java.sun.com/jstl/core is the old one.

Did you include the jstl library?

On 7 February 2011 19:12, Biesbrock, Kevin  wrote:
> Excuse me, I Google searched "jstl taglib"...
>
>
> Beez
> r 5347
>
> -Original Message-
> From: Jose Luis Martinez Avial [mailto:jlmarti...@pb-santander.com]
> Sent: Monday, February 07, 2011 12:56 PM
> To: Struts Users Mailing List
> Subject: RE: JSON Property
>
> Hello,
> I'm trying to use this combination of tags to convert to JSON, but it seems I 
> have some problems with the TLD. I'm getting the following error:
>
> manageDocuments.jsp:2:5: No tag library could be found with this URI. 
> Possible causes could be that the URI is incorrect, or that there were errors 
> during parsing of the .tld file.
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
>
> Which is the correct url? and I suppouse I need the jar that implements the 
> tags, right?where can I find the it?
>
> Thanks
>
> Jose Luis
>
> -Original Message-
> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
> Sent: Thursday, January 06, 2011 11:51 AM
> To: Struts Users Mailing List
> Subject: Re: JSON Property
>
> Try
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
>
> 2011/1/6 Jim Talbut :
>> Ah, sort of.
>> Actually WW-3554 stopped me working that one out :)
>>
>> Now I've moved the JsonPlugin.tld to my own WEB-INF I can make it work, but 
>> not using the syntax you used.
>>
>> If I have:
>> <%@taglib prefix="json" uri="/struts-json-tags" %> <%@taglib 
>> prefix="c" uri="http://java.sun.com/jstl/core"; %> > value="${json:serialize(orderLines)}"/>
>>
>> I get: PWC6236: According to TLD or attribute directive in tag file, 
>> attribute value does not accept any expressions
>>
>> But if I just put ${json:serialize(orderLines)} on its own it does output 
>> the JSON.
>>
>> I'm new to JSTL, do I have to do something in order to use an OGNL-based 
>> expression with c:out?
>>
>>
>> Thanks
>>
>> Jim
>>
>> -Original Message-
>> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
>> Sent: 05 January 2011 19:23
>> To: Struts Users Mailing List
>> Subject: Re: JSON Property
>>
>> Did this answer your question?
>> https://issues.apache.org/jira/browse/WW-3553
>>
>> 2011/1/5 Chris Pratt :
>>> I'm not sure how to make it work, but it would totally rock if we 
>>> could make the "encode" attribute of the  tag extensible by 
>>> plug-in's.
>>> That way the standard tag could possibly supply encode="html" & encode="js"
>>> and the JSON plug-in could add encode="json" and other plug-ins 
>>> could extend it in ways they need.  Just a wild thought.
>>>  (*Chris*)
>>>
>>> On Wed, Jan 5, 2011 at 1:22 AM, Steven Yang  wrote:
>>>
>>>> I think its "bundled" with S2 but as a separate jar, so dont get mistaken.
>>>>
>>>> i am a bit reluctant to share my code, which is old and bad, not 
>>>> that because i am cheap or anything, its because there are better 
>>>> and well-thought code out there (as in JSON plug in) and my code 
>>>> has lots of things tied to my project (bad design..).
>>>>
>>>> and you know what i just checked back on my tag code. I dont think 
>>>> i am doing anything much different from what your doing. I siimply 
>>>> copied the s:property tag code and replaced the output part of the code.
>>>>
>>>> here is the part i replaced.(my tag mimics the "property" tag) 
>>>> try {
>>>>            if (actualValue != null) {
>>>>                if (!(actualValue instanceof String)) { //if 

RE: JSON Property

2011-02-07 Thread Jose Luis Martinez Avial
That was the problem. I hadn't included the jstl library. It works fine now. 
Thanks!! 

-Original Message-
From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com] 
Sent: Monday, February 07, 2011 1:15 PM
To: Struts Users Mailing List
Subject: Re: JSON Property

The right url should be http://java.sun.com/jsp/jstl/core,
http://java.sun.com/jstl/core is the old one.

Did you include the jstl library?

On 7 February 2011 19:12, Biesbrock, Kevin  wrote:
> Excuse me, I Google searched "jstl taglib"...
>
>
> Beez
> r 5347
>
> -----Original Message-----
> From: Jose Luis Martinez Avial [mailto:jlmarti...@pb-santander.com]
> Sent: Monday, February 07, 2011 12:56 PM
> To: Struts Users Mailing List
> Subject: RE: JSON Property
>
> Hello,
> I'm trying to use this combination of tags to convert to JSON, but it seems I 
> have some problems with the TLD. I'm getting the following error:
>
> manageDocuments.jsp:2:5: No tag library could be found with this URI. 
> Possible causes could be that the URI is incorrect, or that there were errors 
> during parsing of the .tld file.
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
>
> Which is the correct url? and I suppouse I need the jar that implements the 
> tags, right?where can I find the it?
>
> Thanks
>
> Jose Luis
>
> -Original Message-
> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
> Sent: Thursday, January 06, 2011 11:51 AM
> To: Struts Users Mailing List
> Subject: Re: JSON Property
>
> Try
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
>
> 2011/1/6 Jim Talbut :
>> Ah, sort of.
>> Actually WW-3554 stopped me working that one out :)
>>
>> Now I've moved the JsonPlugin.tld to my own WEB-INF I can make it work, but 
>> not using the syntax you used.
>>
>> If I have:
>> <%@taglib prefix="json" uri="/struts-json-tags" %> <%@taglib 
>> prefix="c" uri="http://java.sun.com/jstl/core"; %> > value="${json:serialize(orderLines)}"/>
>>
>> I get: PWC6236: According to TLD or attribute directive in tag file, 
>> attribute value does not accept any expressions
>>
>> But if I just put ${json:serialize(orderLines)} on its own it does output 
>> the JSON.
>>
>> I'm new to JSTL, do I have to do something in order to use an OGNL-based 
>> expression with c:out?
>>
>>
>> Thanks
>>
>> Jim
>>
>> -Original Message-
>> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
>> Sent: 05 January 2011 19:23
>> To: Struts Users Mailing List
>> Subject: Re: JSON Property
>>
>> Did this answer your question?
>> https://issues.apache.org/jira/browse/WW-3553
>>
>> 2011/1/5 Chris Pratt :
>>> I'm not sure how to make it work, but it would totally rock if we 
>>> could make the "encode" attribute of the  tag extensible by 
>>> plug-in's.
>>> That way the standard tag could possibly supply encode="html" & encode="js"
>>> and the JSON plug-in could add encode="json" and other plug-ins 
>>> could extend it in ways they need.  Just a wild thought.
>>>  (*Chris*)
>>>
>>> On Wed, Jan 5, 2011 at 1:22 AM, Steven Yang  wrote:
>>>
>>>> I think its "bundled" with S2 but as a separate jar, so dont get mistaken.
>>>>
>>>> i am a bit reluctant to share my code, which is old and bad, not 
>>>> that because i am cheap or anything, its because there are better 
>>>> and well-thought code out there (as in JSON plug in) and my code 
>>>> has lots of things tied to my project (bad design..).
>>>>
>>>> and you know what i just checked back on my tag code. I dont think 
>>>> i am doing anything much different from what your doing. I siimply 
>>>> copied the s:property tag code and replaced the output part of the code.
>>>>
>>>> here is the part i replaced.(my tag mimics the "property" tag) 
>>>> try {
>>>>            if (actualValue != null) {
>>>>                if (!(actualValue instanceof String)) { //if String 
>>>> then treated its as if in JSON format
>>>>                    actualValue = JSONUtil.toJSON(actualValue);
>>>>                }
>>>>                writer.write(actualValue.toString());
>>>>            }
>>>>       

RE: JSON Property

2011-02-07 Thread Jose Luis Martinez Avial
Hello,
I'm trying to use this combination of tags to convert to JSON, but it seems I 
have some problems with the TLD. I'm getting the following error:

manageDocuments.jsp:2:5: No tag library could be found with this URI. Possible 
causes could be that the URI is incorrect, or that there were errors during 
parsing of the .tld file.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %> 

Which is the correct url? and I suppouse I need the jar that implements the 
tags, right?where can I find the it?

Thanks

Jose Luis

-Original Message-
From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com] 
Sent: Thursday, January 06, 2011 11:51 AM
To: Struts Users Mailing List
Subject: Re: JSON Property

Try
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>

2011/1/6 Jim Talbut :
> Ah, sort of.
> Actually WW-3554 stopped me working that one out :)
>
> Now I've moved the JsonPlugin.tld to my own WEB-INF I can make it work, but 
> not using the syntax you used.
>
> If I have:
> <%@taglib prefix="json" uri="/struts-json-tags" %> <%@taglib 
> prefix="c" uri="http://java.sun.com/jstl/core"; %>  value="${json:serialize(orderLines)}"/>
>
> I get: PWC6236: According to TLD or attribute directive in tag file, 
> attribute value does not accept any expressions
>
> But if I just put ${json:serialize(orderLines)} on its own it does output the 
> JSON.
>
> I'm new to JSTL, do I have to do something in order to use an OGNL-based 
> expression with c:out?
>
>
> Thanks
>
> Jim
>
> -Original Message-
> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
> Sent: 05 January 2011 19:23
> To: Struts Users Mailing List
> Subject: Re: JSON Property
>
> Did this answer your question?
> https://issues.apache.org/jira/browse/WW-3553
>
> 2011/1/5 Chris Pratt :
>> I'm not sure how to make it work, but it would totally rock if we 
>> could make the "encode" attribute of the  tag extensible by 
>> plug-in's.
>> That way the standard tag could possibly supply encode="html" & encode="js"
>> and the JSON plug-in could add encode="json" and other plug-ins could 
>> extend it in ways they need.  Just a wild thought.
>>  (*Chris*)
>>
>> On Wed, Jan 5, 2011 at 1:22 AM, Steven Yang  wrote:
>>
>>> I think its "bundled" with S2 but as a separate jar, so dont get mistaken.
>>>
>>> i am a bit reluctant to share my code, which is old and bad, not 
>>> that because i am cheap or anything, its because there are better 
>>> and well-thought code out there (as in JSON plug in) and my code has 
>>> lots of things tied to my project (bad design..).
>>>
>>> and you know what i just checked back on my tag code. I dont think i 
>>> am doing anything much different from what your doing. I siimply 
>>> copied the s:property tag code and replaced the output part of the code.
>>>
>>> here is the part i replaced.(my tag mimics the "property" tag) 
>>> try {
>>>            if (actualValue != null) {
>>>                if (!(actualValue instanceof String)) { //if String 
>>> then treated its as if in JSON format
>>>                    actualValue = JSONUtil.toJSON(actualValue);
>>>                }
>>>                writer.write(actualValue.toString());
>>>            }
>>>            else if (defaultValue != null) {
>>>                writer.write(defaultValue);
>>>            }
>>>        }
>>>        catch (IOException e) {
>>>            LoggerUtil.BASE_LOGGER.info("error ocurred while writing json:
>>> "
>>> + actualValue, e);
>>>         }
>>>
>>> On Wed, Jan 5, 2011 at 4:59 PM, Maurizio Cucchiara < 
>>> maurizio.cucchi...@gmail.com> wrote:
>>>
>>> > The json plugin is bundled with S2, because previously was on 
>>> > google code, and one had to download separately
>>> >
>>> > 2011/1/5 Jim Talbut :
>>> > > You are both right.
>>> > >
>>> > > The tag that I'm using at the moment (which isn't fully tested 
>>> > > at all,
>>> > got some data issues to sort out first) is just the property tag 
>>> > with the following modification:
>>> > >        Object objectValue = getStack().findValue(value,
>>> > throwExceptionOnELFailure);
>>> > >        try {
>>> > >            actualValue = JSONUtil.serialize( objectValue );
>>> > >        } catch( JSONException ex ) {
>>> > >            LOG.error("Could not convert {} to a JSON serialized value:
>>> > {}", objectValue, ex);
>>> > >        }
>>> > >
>>> > > Given that I'm using a utility function from the JSON plugin it 
>>> > > does
>>> seem
>>> > to make sense to have that plugin provide this tag.
>>> > >
>>> > > I've filed a feature request against it (
>>> > https://issues.apache.org/jira/browse/WW-3553), but it doesn't 
>>> > seem to
>>> be
>>> > a very active project.
>>> > > I'm also confused by the fact that this page
>>> > https://cwiki.apache.org/S2PLUGINS/json-plugin.html says that the 
>>> > plugin is bundled with Struts, although the JSONUtil class is not 
>>> > in
>>> struts-core.
>>> > >
>>> > > Steven, if you have a more complete and tested tag co

RE: De-serialize JSON to Action

2011-02-07 Thread Jose Luis Martinez Avial
Actually, the plugin works just fine. It maps correctly each item to a
bean, so I don't need to user List, just List, and it works
correctly.

-Original Message-
From: Harsh C [mailto:hchau...@gmail.com] 
Sent: Monday, January 31, 2011 11:43 PM
To: Struts Users Mailing List
Subject: Re: De-serialize JSON to Action

I would think probably not because at runtime, the JVM would need to
know the type of the objects in the list. But its late here, and I
haven't given it much thought.

On Mon, Jan 31, 2011 at 11:19 PM, JOSE L MARTINEZ-AVIAL
wrote:

> Hello,
>  I was wondering about how to do this, and I just saw your mail. The 
> post is interesting and useful, but I was wondering if it is possible 
> to automatice the conversion for beans. According to the 
> documentation(
> http://struts.apache.org/2.2.1.1/docs/json-plugin.html) a list of 
> beans will be mapped to a List of Maps. For example, let's say I 
> receive the following JSON into my action:
>
> {"identifier":"name",
>  "items":[
> {
> "accessLevel":"NO_ACCESS",
> "desc":"Officers",
> "name":"ECO Officer",
> "type":"ROLE"
> },{
> "accessLevel":"NO_ACCESS",
> "desc":"Publications",
> "name":"ECO Publications Manager",
> "type":"ROLE"
> ],
> "targetIdBox":17101}
>
>As required by the json plugin, I would need to define a 
> setIdentifier(String), setTargetIdBox(int), and a setItems(List).

> That works correctly, but I would like to automatice the conversion 
> from a Map to a bean. Is it possible?
>
>Thanks
>
> Jose Luis
>
> 2011/1/31 Harsh C 
>
> > Looks like this will work for me. Thanks!
> >
> > On Mon, Jan 31, 2011 at 4:14 PM, Johannes Geppert 
wrote:
> >
> > >
> > > for a while i wrote a blog post "How to parse a JSON Object when 
> > > using multiSearch for jqGrid with Java", I think you can adopt it 
> > > to your problem.
> > >
> > >
> > >
> > >
> >
> http://www.jgeppert.com/2010/06/how-to-parse-a-json-object-when-using-
> multisearch-for-jqgrid-with-java/
> > >
> > >
> >
> http://www.jgeppert.com/2010/06/how-to-parse-a-json-object-when-using-
> multisearch-for-jqgrid-with-java/
> > >
> > > Johannes
> > >
> > >
> > > Harsh C wrote:
> > > >
> > > > I have been working with the Struts 2 JSON plugin and I have got

> > > > it
> set
> > > up
> > > > so that I can serialize my Java beans as a JSON string and pass 
> > > > it
> > along
> > > > to
> > > > the browser.
> > > > Is the reverse possible using the plugin? That is, if I have a 
> > > > JS
> > widget
> > > > (Dojo, in this case) that spits out JSON, can I read in the JSON
> string
> > > > and
> > > > "de-serialize" it to a Java bean?
> > > >
> > > > I would appreciate it if someone could point me to a 
> > > > best-practice
> for
> > > > doing
> > > > so.
> > > >
> > > > --
> > > > *Thanks,
> > > > Harsh*
> > > >
> > > >
> > >
> > >
> > > -
> > > ---
> > > web: http://www.jgeppert.com
> > > twitter: http://twitter.com/jogep
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://old.nabble.com/De-serialize-JSON-to-Action-tp30810552p30810811.
> html
> > > Sent from the Struts - User mailing list archive at Nabble.com.
> > >
> > >
> > > --
> > > --- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > > For additional commands, e-mail: user-h...@struts.apache.org
> > >
> > >
> >
> >
> > --
> > *Thanks,
> > Harsh*
> >
>



--
*Thanks,
Harsh*

Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: De-serialize JSON to Action

2011-02-01 Thread Jose Luis Martinez Avial
Well, Struts does it in the ParametersInterceptor, so it shouldn't be
difficult to 'map' a map to a bean. I haven't had the time to dig on
that, but maybe someone has and can propose some way to do it.

JL

-Original Message-
From: Harsh C [mailto:hchau...@gmail.com] 
Sent: Monday, January 31, 2011 11:43 PM
To: Struts Users Mailing List
Subject: Re: De-serialize JSON to Action

I would think probably not because at runtime, the JVM would need to
know the type of the objects in the list. But its late here, and I
haven't given it much thought.

On Mon, Jan 31, 2011 at 11:19 PM, JOSE L MARTINEZ-AVIAL
wrote:

> Hello,
>  I was wondering about how to do this, and I just saw your mail. The 
> post is interesting and useful, but I was wondering if it is possible 
> to automatice the conversion for beans. According to the 
> documentation(
> http://struts.apache.org/2.2.1.1/docs/json-plugin.html) a list of 
> beans will be mapped to a List of Maps. For example, let's say I 
> receive the following JSON into my action:
>
> {"identifier":"name",
>  "items":[
> {
> "accessLevel":"NO_ACCESS",
> "desc":"Officers",
> "name":"ECO Officer",
> "type":"ROLE"
> },{
> "accessLevel":"NO_ACCESS",
> "desc":"Publications",
> "name":"ECO Publications Manager",
> "type":"ROLE"
> ],
> "targetIdBox":17101}
>
>As required by the json plugin, I would need to define a 
> setIdentifier(String), setTargetIdBox(int), and a setItems(List).

> That works correctly, but I would like to automatice the conversion 
> from a Map to a bean. Is it possible?
>
>Thanks
>
> Jose Luis
>
> 2011/1/31 Harsh C 
>
> > Looks like this will work for me. Thanks!
> >
> > On Mon, Jan 31, 2011 at 4:14 PM, Johannes Geppert 
wrote:
> >
> > >
> > > for a while i wrote a blog post "How to parse a JSON Object when 
> > > using multiSearch for jqGrid with Java", I think you can adopt it 
> > > to your problem.
> > >
> > >
> > >
> > >
> >
> http://www.jgeppert.com/2010/06/how-to-parse-a-json-object-when-using-
> multisearch-for-jqgrid-with-java/
> > >
> > >
> >
> http://www.jgeppert.com/2010/06/how-to-parse-a-json-object-when-using-
> multisearch-for-jqgrid-with-java/
> > >
> > > Johannes
> > >
> > >
> > > Harsh C wrote:
> > > >
> > > > I have been working with the Struts 2 JSON plugin and I have got

> > > > it
> set
> > > up
> > > > so that I can serialize my Java beans as a JSON string and pass 
> > > > it
> > along
> > > > to
> > > > the browser.
> > > > Is the reverse possible using the plugin? That is, if I have a 
> > > > JS
> > widget
> > > > (Dojo, in this case) that spits out JSON, can I read in the JSON
> string
> > > > and
> > > > "de-serialize" it to a Java bean?
> > > >
> > > > I would appreciate it if someone could point me to a 
> > > > best-practice
> for
> > > > doing
> > > > so.
> > > >
> > > > --
> > > > *Thanks,
> > > > Harsh*
> > > >
> > > >
> > >
> > >
> > > -
> > > ---
> > > web: http://www.jgeppert.com
> > > twitter: http://twitter.com/jogep
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://old.nabble.com/De-serialize-JSON-to-Action-tp30810552p30810811.
> html
> > > Sent from the Struts - User mailing list archive at Nabble.com.
> > >
> > >
> > > --
> > > --- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > > For additional commands, e-mail: user-h...@struts.apache.org
> > >
> > >
> >
> >
> > --
> > *Thanks,
> > Harsh*
> >
>



--
*Thanks,
Harsh*

Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Strtus2: httpheader result does not sent headers with hyphenated names

2011-01-12 Thread Jose Luis Martinez Avial
Yes, it worked!!. Thanks.

Jose Luis 

-Original Message-
From: Dave Newton [mailto:davelnew...@gmail.com] 
Sent: Wednesday, January 12, 2011 6:00 PM
To: Struts Users Mailing List
Subject: Re: Strtus2: httpheader result does not sent headers with
hyphenated names

Did you try my original answer?!

Dave

On Wed, Jan 12, 2011 at 10:59 AM, Jose Luis Martinez Avial <
jlmarti...@pb-santander.com> wrote:

> Hi all,
>
>I'm using Struts .2.1.8.1, and I've found a problem when I use 
> result type httpheader and I try to use a header name with a hyphen.
> They don't get sent. For example, the following result definition:
>
>  type="httpheader">
>
>401
>
>NTLM
>
>my header
>
>NTLM
>
> 
>
>I receive the headers "a" and "WWWAuthenticate", but no the header 
> "WWW-Authenticate". Is there any way to fix this behaviour?
>
>
>
>Thanks.
>
>
>
> Jose
>
>
>
>
>
> Internet communications are not secure and therefore Banco Santander 
> International does not accept legal responsibility for the contents of

> this message. Any views or opinions presented are solely those of the 
> author and do not necessarily represent those of Banco Santander 
> International unless otherwise specifically stated.
>
> Las comunicaciones via Internet no son seguras y por lo tanto Banco 
> Santander International no asume responsabilidad legal ni de ningun 
> otro tipo por el contenido de este mensaje. Cualquier opinion 
> transmitida pertenece unicamente al autor y no necesariamente 
> representa la opinion del Banco Santander International a no ser que 
> este expresamente detallado.
>
>

Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



HowRE: Struts2: httpheader result does not sent headers with hyphenated names

2011-01-12 Thread Jose Luis Martinez Avial
I launched an exception to get the stacktrace, and it calls OGNL:

java.lang.Throwable
at
com.spb.mvc.controller.web.struts2.json.ResponseJSONResult.setMyValue(Re
sponseJSONResult.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:830)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1253)
at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1454)
at
ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.j
ava:85)
at
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
at
com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectA
ccessor.java:28)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2225)
at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.Ognl.setValue(Ognl.java:737)
at
com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
at
com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:
394)
at
com.opensymphony.xwork2.ognl.OgnlUtil.setProperty(OgnlUtil.java:149)
at
com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperty(OgnlRefl
ectionProvider.java:91)
at
com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:221
)
at
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActi
onInvocation.java:209)
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct
ionInvocation.java:356)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:266)
at
com.spb.mvc.security.authoritation.web.AuthoritationInterceptor.intercep
t(AuthoritationInterceptor.java:100)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:237)
at
com.spb.mvc.controller.web.BusinessContextInterceptor.intercept(Business
ContextInterceptor.java:30)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:237)
at
com.spb.mvc.security.authentication.web.AuthenticationInterceptor.interc
ept(AuthenticationInterceptor.java:53)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:237)

 Any idea on how to avoid this behaviour?

-Original Message-
From: Dave Newton [mailto:davelnew...@gmail.com] 
Sent: Wednesday, January 12, 2011 12:30 PM
To: Struts Users Mailing List
Subject: Re: Struts2: httpheader result does not sent headers with
hyphenated names

I wonder if that's an OGNL thing.

Dave

On Wed, Jan 12, 2011 at 12:24 PM, JOSE L MARTINEZ-AVIAL
wrote:

> Hi all,
>
>I'm using Struts .2.1.8.1, and I've found a problem when I use  
> result type httpheader and I try to use a header name with a hyphen. 
> They don't get sent. For example, the following result definition:
>
>  type="httpheader">
>
>401
>
>NTLM
>
>my header
>
>NTLM
>
> 
>
>I receive the headers "a" and "WWWAuthenticate", but no the header 
> "WWW-Authenticate". Is there any way to fix this behaviour?
>
>
>
>Thanks.
>
>
>
> Jose
>

Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Strtus2: httpheader result does not sent headers with hyphenated names

2011-01-12 Thread Jose Luis Martinez Avial
Hi all,

I'm using Struts .2.1.8.1, and I've found a problem when I use
result type httpheader and I try to use a header name with a hyphen.
They don't get sent. For example, the following result definition:



401

NTLM

my header

NTLM



I receive the headers "a" and "WWWAuthenticate", but no the header
"WWW-Authenticate". Is there any way to fix this behaviour?

 

Thanks.

 

Jose





Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



Invocation of type conversion manually

2010-12-09 Thread Jose Luis Martinez Avial
Hello all,
I'm using Struts 2..1.8.1 for an application. To integrate the
security in the application we have developed an interceptor that
intercepts every request and checks a list of rules(implemented as
classes) to know if the user is allowed to execute the action. The
validation should be dinamic, so the rules should be able to receive
information from the request. What I would like to do is to use Struts'
mechanism to process, parse and type-convert  the request's parameters
to do that. So I would invocate the Struts' conversion over the classes
implementing the rules, and set the parameters in the rules, the same
way Struts does with the actions. I've tried looking at the code, but
I'm a bit lost. Can somebody give some orientation on how to invoke the
conversion?
 
Thanks
 
JL


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



Redirect non-exisings URLs to a default one creates akward URLs

2010-11-09 Thread Jose Luis Martinez Avial
Helllo all,
I'm using Struts 2.1.8.1 with two packages defined as follow:

 
 
 
 
  Login
 
 
 
  main/Dashboard
 
 

 

 
 
 
 
  MenuCliente
 
 

 
If I input http://myserver/main/whatever it automatically redirects me
to http://myserver/main/Dashboard The same happens if I input
http://myserver/whatever But if whatever contains a forward slash, I got
problems. For example http://myserver/main/ redirects me to
http://myserver/main/main/Dashboard
 , which is not correct. The same
happens if I go to http://myserver/main/aaa/ . The second case mades
sense, since the namespace /main/ does not exists, so it looks for
the default action in namespace /. and redirects to main/DashBoard,
creating the http://myserver/main/main/Dashboard. How can I make it
redirect that case to http://myserver/main/main/Dashboard
  (without using the
http://myserver in the redirection)? And what happens with the first
case? shouldn't that request be redirected to Dashboard,(since there is
a namespaces "/main" with that default action) insted of being
redirected to main/Dashboard. It seems is looking in the namespaces "/"
rather than in the namespaces "/main"
 
TIA
 
Jose  


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



RE: RequestHeaderAware in Struts 2?

2010-10-27 Thread Jose Luis Martinez Avial
Gello Dave,
There is nothing wrong with the ideas you gave me. I particulary like 
Li's idea. What I'm saying is that to get the IP address is a different story, 
since there maybe some logic involved that depends on the context. I'm thinking 
which is the most orthodox and clean way to do it. and if a 
RemoteAddressInterceptor would make sense. For example, while I think a 
RequestHeaderIntereceptor could (and I think it should) be added to the Struts2 
stack, I'm not so sure about a RemoteAddressIntecerptor, that's why I ask for 
any ideas about the best way to implement it.

Jose

-Original Message-
From: Dave Newton [mailto:davelnew...@gmail.com] 
Sent: Wednesday, October 27, 2010 3:39 AM
To: Struts Users Mailing List
Subject: Re: RequestHeaderAware in Struts 2?

What's wrong with the ideas you've been given? Ying's is exactly what you asked 
for, Chris's might be more suitable if you want to set one or two action 
properties based on one or two header values.

Another thing to consider is how the values will actually be used: the 
application-specific "context" of the header values. What expresses your intent 
most clearly? An action that implements "RequestHeaderAware", or an action that 
is "RemoteIPAddrAware" (or whatever)?

Dave

On Tuesday, October 26, 2010, Jose Luis Martinez Avial 
 wrote:
> Well, that's an option. Another thing I would need to get is the Remote 
> Address. That can be complicated, since sometimes -specially when you are 
> behind a proxy, or something like that- the IP address you get is not 
> correct. In those cases with a proxy usually the IP is in a header in the 
> request(For example, if you are using Apache, you will get a 
> "x-forwarded-for" header in the request). I was thinking about doing an 
> interceptor that can be setup to look for that header(Or one similar, that 
> can be setup in the struts xml) and if it's not present, set the IP into the 
> action. What do you think?
>
> Jose
>
> -Original Message-
> From: Li Ying [mailto:liying.cn.2...@gmail.com]
> Sent: Tuesday, October 26, 2010 3:32 AM
> To: Struts Users Mailing List
> Subject: Re: RequestHeaderAware in Struts 2?
>
> What Chris has said is right.
>
> But what Jose Luis asked for is a inject mechanism likes ParameterAware which 
> takes all the request params through one Map, but not through several 
> property.
>
> So I think the simpler (also more Quick And Dirty) way is:
>
> (1)Create a interface, likes:
> public interface HeaderAware {
>         /**
>          * Sets the map of request headers in the implementing class.
>          *
>          * @param headers
>          *            a Map of headers (name/value Strings).
>          */
>         public void setHeaders(final Map headers); }
>
> (2)implement this interface in your action class (or the common super 
> class of all of your actions)
>
> (3)create a interceptor, which inject the headers map to your action class 
> likes what ServletConfigInterceptor is doing, the code will likes:
>
> public class RequestHeaderInterceptor extends AbstractInterceptor {
>        �...@override
>         public String intercept(final ActionInvocation invocation) 
> throws Exception {
>                 final Object action = invocation.getAction();
>
>                 if (action instanceof HeaderAware) {
>                         Map requestHeaders =
>                                         
> this.getRequestHeaders(ServletActionContext.getRequest());
>                         ((HeaderAware) 
> action).setHeaders(requestHeaders);
>                 }
>
>                 return invocation.invoke();
>         }
>
>         private Map getRequestHeaders(
>                         final HttpServletRequest request) {
>                 Map headers = new HashMap String[]>();
>
>                 // TODO: retrieve all the request headers by
>                 // HttpServletRequest.getHeaderNames(), 
> HttpServletRequest.getHeaders()
>                 // and put them into Map
>
>                 return headers;
>         }
> }
>
> (4)add RequestHeaderInterceptor into your interceptor-stack
>
>
>
> 2010/10/26 Chris Pratt :
>> As far as I'm aware, there's not.  But it wouldn't be hard to write one.
>> You could use the ParameterInterceptor as a pattern, but have it take 
>> it's data from the headers rather than the parameters and you'd be 
>> done in 1/2 hr.  You could get fancier, to make sure Parameters and 
>> Headers with the same name don't clash, and use an Annotation to 
>> identify which headers to inject into which methods, but that would 
>&g

RE: RequestHeaderAware in Struts 2?

2010-10-27 Thread Jose Luis Martinez Avial
Well, that's an option. Another thing I would need to get is the Remote 
Address. That can be complicated, since sometimes -specially when you are 
behind a proxy, or something like that- the IP address you get is not correct. 
In those cases with a proxy usually the IP is in a header in the request(For 
example, if you are using Apache, you will get a "x-forwarded-for" header in 
the request). I was thinking about doing an interceptor that can be setup to 
look for that header(Or one similar, that can be setup in the struts xml) and 
if it's not present, set the IP into the action. What do you think?

Jose

-Original Message-
From: Li Ying [mailto:liying.cn.2...@gmail.com] 
Sent: Tuesday, October 26, 2010 3:32 AM
To: Struts Users Mailing List
Subject: Re: RequestHeaderAware in Struts 2?

What Chris has said is right.

But what Jose Luis asked for is a inject mechanism likes ParameterAware which 
takes all the request params through one Map, but not through several property.

So I think the simpler (also more Quick And Dirty) way is:

(1)Create a interface, likes:
public interface HeaderAware {
/**
 * Sets the map of request headers in the implementing class.
 *
 * @param headers
 *a Map of headers (name/value Strings).
 */
public void setHeaders(final Map headers); }

(2)implement this interface in your action class (or the common super class of 
all of your actions)

(3)create a interceptor, which inject the headers map to your action class 
likes what ServletConfigInterceptor is doing, the code will likes:

public class RequestHeaderInterceptor extends AbstractInterceptor {
@Override
public String intercept(final ActionInvocation invocation) throws 
Exception {
final Object action = invocation.getAction();

if (action instanceof HeaderAware) {
Map requestHeaders =

this.getRequestHeaders(ServletActionContext.getRequest());
((HeaderAware) action).setHeaders(requestHeaders);
}

return invocation.invoke();
}

private Map getRequestHeaders(
final HttpServletRequest request) {
Map headers = new HashMap();

// TODO: retrieve all the request headers by
// HttpServletRequest.getHeaderNames(), 
HttpServletRequest.getHeaders()
// and put them into Map

return headers;
}
}

(4)add RequestHeaderInterceptor into your interceptor-stack



2010/10/26 Chris Pratt :
> As far as I'm aware, there's not.  But it wouldn't be hard to write one.
> You could use the ParameterInterceptor as a pattern, but have it take 
> it's data from the headers rather than the parameters and you'd be 
> done in 1/2 hr.  You could get fancier, to make sure Parameters and 
> Headers with the same name don't clash, and use an Annotation to 
> identify which headers to inject into which methods, but that would 
> definitely take more than 1/2 hr.
> =8^)
>  (*Chris*)
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RequestHeaderAware in Struts 2?

2010-10-25 Thread Jose Luis Martinez Avial
Hello,
   I'm working on an application that for security reasons needs to
access to the request headers from an action. I know I can access to the
request, but I'm also aware that that is not recomended. Is there a
RequestHeaderAware or something like that, that fits that the same
behaviour as ParameterAware, but with reference to the request headers?
 
Thanks
 
JL


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



Tiles2 error with javax.portlet.PortletRequest not found

2010-10-08 Thread Jose Luis Martinez Avial
Hello,
I'm using Struts 2.1.8.1 with Tiles 2.1.4. I'm getting the following
error when I try to deploy the application in WL 10.3:
java.lang.NoClassDefFoundError: javax/portlet/PortletRequest
at
org.apache.tiles.portlet.context.PortletTilesRequestContextFactory.(PortletTilesRequestContextFactory.java:66)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
ccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)
at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
Truncated. see log file for complete stacktrace

I'm not using portlets at all, and curiously the error does not happen
when I deploy the application in Jboss 4.0.5.  Does somebody know what's
happening?
 
Thanks
 
Jose 


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



Distinguish between request parameters and struts.xml parameters in Struts2

2010-01-13 Thread Jose Luis Martinez Avial
Hi all,
  I'm trying to distinguish the parameters that come from the request
from those that come from the params defined in the struts.xml. For
example, I have the following mapping in my struts.xml
 

my resource
/example/Login.jsp
Menu

 
The call to that action will have a variable number of parameters, so I
want to distinguish between them and the parameter defined in the
struts.xml. How can I do that? In Struts 1 I was able to use the tag
, and since the action was separated from the form, there
was no problem, but in Struts2 that is no longer possible. Any ideas?
 
Thanks
 
Jose Luis


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



Struts2: Multiple parameters with same name in Action definition

2010-01-13 Thread Jose Luis Martinez Avial
Hi all,
I'm trying to define an action that can be reused in multiple
definitions. They will receive a variable number of parameters from the
mapping definition
 

value1
value2
value3
value4
/example/Login.jsp
Menu

 
So in the class I will have something like the following:
 
public class Login extends ExampleSupport {
 
 private Set securityParameter= new HashSet();
 
 public void setSecurityParameter(String securityParameter){
  securityParameter.add(securityParameter);
 }
}
 
What I am getting is only the last param value. Is there aniway to load
all the parameter values?
 
Thanks!
 
Jose Luis


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



set-property in action-mapping in Struts 2

2010-01-13 Thread Jose Luis Martinez Avial
Hi,
In Struts 1 I was able to extend the class ActionMapping and declare
additional properties for a mapping in the struts-config.xml








by creating the method setPublica in the class MyActionMapping. Is it
possible to do something similar in Struts 2? I've seen that there is a
param element in the DTD, but I haven't found any example of how to use
it. I want to have access to that property/param from an Interceptor.
How can I do that?

TIA

Jose Luis



Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are
solely those of the author and do not necessarily represent those
of Banco Santander International unless otherwise specifically
stated.

Las comunicaciones via Internet no son seguras y por lo tanto
Banco Santander International no asume responsabilidad legal
ni
de ningun otro tipo por el contenido de este mensaje. Cualquier
opinion transmitida pertenece unicamente al autor y no
necesariamente representa la opinion del Banco Santander
International a no ser que este expresamente detallado.



RE: Tiles: definition without path

2007-08-22 Thread Jose Luis Martinez Avial
It's not as easy as modifying the code the way I did, because if you use
the validation in a form, and the validation fails, it goes through the
tiles processor with and uri null, and because of the modifications it
fails coming back to the original screen.

So I've put the old code(in fact the normal code) and change the
include/forward code from:
...
   if (doInclude) {
   log.info("Tiles process complete; doInclude with " +
uri);
   doInclude(sacontext, uri);
   } else {
   log.info("Tiles process complete; forward to " + uri);
   doForward(sacontext, uri);
   }
...
To
...
uri = uri.trim();
if (uri.length()>0)
{
   if (doInclude) {
   log.info("Tiles process complete; doInclude with " +
uri);
   doInclude(sacontext, uri);
   } else {
   log.info("Tiles process complete; forward to " + uri);
   doForward(sacontext, uri);
   }
}
...

And put path = "" in the tiles-def.xml. Again I don't know the
implications, but at this moment it works for me.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Paul Benedict
Sent: Wednesday, August 22, 2007 02:43 AM
To: Struts Users Mailing List
Subject: Re: Tiles: definition without path

Please see:
https://issues.apache.org/struts/browse/STR-1981

Paul

On 8/21/07, Jose Luis Martinez Avial <[EMAIL PROTECTED]>
wrote:
>
> I've tried to modify the execute method of TilesPreProcessor from
>
> ...
> if(uri == null)
> {
> log.debug("no uri computed, so pass to next command");
> return false;
> }
> if(controller != null)
> {
> log.trace("Execute controller: " + controller);
> controller.execute(tileContext, sacontext.getRequest(),
> sacontext.getResponse(), sacontext.getContext());
> }
> ...
>
> To
> ...
> if (controller != null) {
> log.trace("Execute controller: " + controller);
>
>
controller.execute(tileContext,sacontext.getRequest(),sacontext.getRespo
> nse(),sacontext.getContext());
> }
> if (uri == null) {
> log.debug("no uri computed, so pass to next command");
> sacontext.setForwardConfig( null );
> return false;
> }
> ...
>
> So it execute the controller even if the uri is null, and after that
if
> the uri is null, it will put the ForwardConfig to null and return,
> because is the end of the processing. It works for me, but I don't
know
> all the implications of this change.
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> On Behalf Of Paul Benedict
> Sent: Tuesday, August 21, 2007 18:32 PM
> To: Struts Users Mailing List
> Subject: Re: Tiles: definition without path
>
> I'll have to investigate this.
>
> On 8/21/07, Jose Luis Martinez Avial
<[EMAIL PROTECTED]>
> wrote:
> >
> > The question is that I don't need to forward to a JSP. The
controller
> > takes the HttpServletResponse and writes in it, and that is the
> response
> > to the user. Before that I put the image as an attribute in the
> request,
> > and in a JSP template I recovered it form the request, and wrote it,
> but
> > the tomcat always said that the Output stream had already been
closed.
> >
> > Is there anyway to return a image to the user using a controller
> without
> > using a JSP?
> >
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
> > On Behalf Of Paul Benedict
> > Sent: Tuesday, August 21, 2007 18:18 PM
> > To: Struts Users Mailing List
> > Subject: Re: Tiles: definition without path
> >
> > I don't understand why you haven't provided a path attribute on the
> > definition. Definitions need to resolve to a resource. I don't see a
> JSP
> > listed.
> >
> > On 8/21/07, Jose Luis Martinez Avial
> <[EMAIL PROTECTED]>
> > wrote:
> > >
> > > I'm using Struts 1.3.9, with Tiles. I've one action that calls to
a
> > > definition
> > > struts-config.xml
> > > > > forward="verGraphPortfolio.pantalla"/>
> > >
> > > riles-def..xml
> > > > >
> >
>
controllerClass="com.bpi.isis.customer.web.vista.PortfolioValGraphContro
> > > ller"/>
> > >
> > >In the PortfolioValGraphController I 

RE: Tiles: definition without path

2007-08-21 Thread Jose Luis Martinez Avial
I've tried to modify the execute method of TilesPreProcessor from

...
if(uri == null)
{
log.debug("no uri computed, so pass to next command");
return false;
}
if(controller != null)
{
log.trace("Execute controller: " + controller);
controller.execute(tileContext, sacontext.getRequest(),
sacontext.getResponse(), sacontext.getContext());
}
...

To 
...
if (controller != null) {
log.trace("Execute controller: " + controller);
 
controller.execute(tileContext,sacontext.getRequest(),sacontext.getRespo
nse(),sacontext.getContext());
}
if (uri == null) {
log.debug("no uri computed, so pass to next command");
sacontext.setForwardConfig( null );
return false;
}
...

So it execute the controller even if the uri is null, and after that if
the uri is null, it will put the ForwardConfig to null and return,
because is the end of the processing. It works for me, but I don't know
all the implications of this change.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Paul Benedict
Sent: Tuesday, August 21, 2007 18:32 PM
To: Struts Users Mailing List
Subject: Re: Tiles: definition without path

I'll have to investigate this.

On 8/21/07, Jose Luis Martinez Avial <[EMAIL PROTECTED]>
wrote:
>
> The question is that I don't need to forward to a JSP. The controller
> takes the HttpServletResponse and writes in it, and that is the
response
> to the user. Before that I put the image as an attribute in the
request,
> and in a JSP template I recovered it form the request, and wrote it,
but
> the tomcat always said that the Output stream had already been closed.
>
> Is there anyway to return a image to the user using a controller
without
> using a JSP?
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> On Behalf Of Paul Benedict
> Sent: Tuesday, August 21, 2007 18:18 PM
> To: Struts Users Mailing List
> Subject: Re: Tiles: definition without path
>
> I don't understand why you haven't provided a path attribute on the
> definition. Definitions need to resolve to a resource. I don't see a
JSP
> listed.
>
> On 8/21/07, Jose Luis Martinez Avial
<[EMAIL PROTECTED]>
> wrote:
> >
> > I'm using Struts 1.3.9, with Tiles. I've one action that calls to a
> > definition
> > struts-config.xml
> > > forward="verGraphPortfolio.pantalla"/>
> >
> > riles-def..xml
> > >
>
controllerClass="com.bpi.isis.customer.web.vista.PortfolioValGraphContro
> > ller"/>
> >
> >In the PortfolioValGraphController I have this code
> >
> > 
> > response.setHeader("Content-Disposition", "inline");
> > response.setHeader("Cache-Control", "no-cache");
> > response.setHeader("Cache-Control", "no-store");
> > response.setHeader("Cache-Control",
> "must-revalidate");
> >
response.getOutputStream().write(baos.toByteArray());
> > response.getOutputStream().flush();
> > response.getOutputStream().close();
> > response.setStatus(HttpServletResponse.SC_OK);
> > baos.close();
> > baos = null;
> > .
> >
> > If I don't put the path attribute in the definition, the controller
is
> > not invocated and the user doesn't see the image. In the logs your
can
> > see this:
> >
> > 21 Aug 2007 13:11:36,711  DEBUG
> > org.apache.struts.tiles.ComponentDefinition  - Controller created :
> > [EMAIL PROTECTED]
> > 21 Aug 2007 13:11:36,711  DEBUG
> > org.apache.struts.tiles.commands.TilesPreProcessor  - no uri
computed,
> > so pass to next command
> > 21 Aug 2007 13:11:36,711  DEBUG
> > org.apache.struts.chain.commands.ActionCommandBase  - Executing
> > org.apache.struts.chain.commands.servlet.PerformForward
> > 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.util.RequestUtils
-
> > No actionId found for verGraphPortfolio.pantalla
> > 21 Aug 2007 13:11:36,711  DEBUG
> > org.apache.struts.chain.commands.ExceptionCatcher  - Attempting to
> > handle a thrown exception
> > 21 Aug 2007 13:11:36,711  DEBUG
> > org.apache.struts.chain.commands.ExceptionCatcher  - Calling
> > exceptionCommand 'servlet-exception'
> > 21 Aug 2007 13:11:36,711  DEBUG
> > org.apac

RE: Tiles: definition without path

2007-08-21 Thread Jose Luis Martinez Avial
The question is that I don't need to forward to a JSP. The controller
takes the HttpServletResponse and writes in it, and that is the response
to the user. Before that I put the image as an attribute in the request,
and in a JSP template I recovered it form the request, and wrote it, but
the tomcat always said that the Output stream had already been closed.

Is there anyway to return a image to the user using a controller without
using a JSP?


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Paul Benedict
Sent: Tuesday, August 21, 2007 18:18 PM
To: Struts Users Mailing List
Subject: Re: Tiles: definition without path

I don't understand why you haven't provided a path attribute on the
definition. Definitions need to resolve to a resource. I don't see a JSP
listed.

On 8/21/07, Jose Luis Martinez Avial <[EMAIL PROTECTED]>
wrote:
>
> I'm using Struts 1.3.9, with Tiles. I've one action that calls to a
> definition
> struts-config.xml
> forward="verGraphPortfolio.pantalla"/>
>
> riles-def..xml
>
controllerClass="com.bpi.isis.customer.web.vista.PortfolioValGraphContro
> ller"/>
>
>In the PortfolioValGraphController I have this code
>
> 
> response.setHeader("Content-Disposition", "inline");
> response.setHeader("Cache-Control", "no-cache");
> response.setHeader("Cache-Control", "no-store");
> response.setHeader("Cache-Control",
"must-revalidate");
> response.getOutputStream().write(baos.toByteArray());
> response.getOutputStream().flush();
> response.getOutputStream().close();
> response.setStatus(HttpServletResponse.SC_OK);
> baos.close();
> baos = null;
> .
>
> If I don't put the path attribute in the definition, the controller is
> not invocated and the user doesn't see the image. In the logs your can
> see this:
>
> 21 Aug 2007 13:11:36,711  DEBUG
> org.apache.struts.tiles.ComponentDefinition  - Controller created :
> [EMAIL PROTECTED]
> 21 Aug 2007 13:11:36,711  DEBUG
> org.apache.struts.tiles.commands.TilesPreProcessor  - no uri computed,
> so pass to next command
> 21 Aug 2007 13:11:36,711  DEBUG
> org.apache.struts.chain.commands.ActionCommandBase  - Executing
> org.apache.struts.chain.commands.servlet.PerformForward
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.util.RequestUtils  -
> No actionId found for verGraphPortfolio.pantalla
> 21 Aug 2007 13:11:36,711  DEBUG
> org.apache.struts.chain.commands.ExceptionCatcher  - Attempting to
> handle a thrown exception
> 21 Aug 2007 13:11:36,711  DEBUG
> org.apache.struts.chain.commands.ExceptionCatcher  - Calling
> exceptionCommand 'servlet-exception'
> 21 Aug 2007 13:11:36,711  DEBUG
> org.apache.struts.chain.commands.ActionCommandBase  - Executing
> org.apache.struts.chain.commands.servlet.ExceptionHandler
> 21 Aug 2007 13:11:36,711  DEBUG
> org.apache.struts.chain.commands.AbstractExceptionHandler  - See if
> actionConfig
>
ActionConfig[cancellable=false,path=/customer/verGraphPortfolio,validate
> =true,forward=verGraphPortfolio.pantalla,scope=session has an
> exceptionConfig for java.lang.IllegalArgumentException
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException: look locally for java.lang.IllegalArgumentException
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException: look globally for java.lang.IllegalArgumentException
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException: look locally for java.lang.RuntimeException
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException: look globally for java.lang.RuntimeException
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException: look locally for java.lang.Exception
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException: look globally for java.lang.Exception
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException: look locally for java.lang.Throwable
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException: look globally for java.lang.Throwable
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException: look locally for java.lang.Object
> 21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig
-
> findException

Tiles: definition without path

2007-08-21 Thread Jose Luis Martinez Avial
I'm using Struts 1.3.9, with Tiles. I've one action that calls to a
definition 
struts-config.xml
   

riles-def..xml
   
   
   In the PortfolioValGraphController I have this code
   

response.setHeader("Content-Disposition", "inline");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setHeader("Cache-Control", "must-revalidate");
response.getOutputStream().write(baos.toByteArray());
response.getOutputStream().flush();
response.getOutputStream().close();
response.setStatus(HttpServletResponse.SC_OK);
baos.close();
baos = null;
.

If I don't put the path attribute in the definition, the controller is
not invocated and the user doesn't see the image. In the logs your can
see this:

21 Aug 2007 13:11:36,711  DEBUG
org.apache.struts.tiles.ComponentDefinition  - Controller created :
[EMAIL PROTECTED]
21 Aug 2007 13:11:36,711  DEBUG
org.apache.struts.tiles.commands.TilesPreProcessor  - no uri computed,
so pass to next command
21 Aug 2007 13:11:36,711  DEBUG
org.apache.struts.chain.commands.ActionCommandBase  - Executing
org.apache.struts.chain.commands.servlet.PerformForward
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.util.RequestUtils  -
No actionId found for verGraphPortfolio.pantalla
21 Aug 2007 13:11:36,711  DEBUG
org.apache.struts.chain.commands.ExceptionCatcher  - Attempting to
handle a thrown exception
21 Aug 2007 13:11:36,711  DEBUG
org.apache.struts.chain.commands.ExceptionCatcher  - Calling
exceptionCommand 'servlet-exception'
21 Aug 2007 13:11:36,711  DEBUG
org.apache.struts.chain.commands.ActionCommandBase  - Executing
org.apache.struts.chain.commands.servlet.ExceptionHandler
21 Aug 2007 13:11:36,711  DEBUG
org.apache.struts.chain.commands.AbstractExceptionHandler  - See if
actionConfig
ActionConfig[cancellable=false,path=/customer/verGraphPortfolio,validate
=true,forward=verGraphPortfolio.pantalla,scope=session has an
exceptionConfig for java.lang.IllegalArgumentException
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look locally for java.lang.IllegalArgumentException
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look globally for java.lang.IllegalArgumentException
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look locally for java.lang.RuntimeException
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look globally for java.lang.RuntimeException
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look locally for java.lang.Exception
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look globally for java.lang.Exception
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look locally for java.lang.Throwable
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look globally for java.lang.Throwable
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look locally for java.lang.Object
21 Aug 2007 13:11:36,711  DEBUG org.apache.struts.config.ActionConfig  -
findException: look globally for java.lang.Object
21 Aug 2007 13:11:36,711  WARN
org.apache.struts.chain.commands.AbstractExceptionHandler  - Unhandled
exception
java.lang.IllegalArgumentException: Path verGraphPortfolio.pantalla does
not start with a "/" character
at
org.apache.catalina.core.ApplicationContext.getRequestDispatcher(Applica
tionContext.java:379)
at
org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(A
pplicationContextFacade.java:195)
at
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(
PerformForward.java:107)
at
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformF
orward.java:96)




If I put path = "", then the controller is invocated, and the user see
the image, but you see this logs
21 Aug 2007 13:11:28,320  INFO
org.apache.struts.tiles.commands.TilesPreProcessor  - Tiles process
complete; forward to 
21 Aug 2007 13:11:28,320  DEBUG
org.apache.struts.chain.commands.ExceptionCatcher  - Attempting to
handle a thrown exception
21 Aug 2007 13:11:28,320  DEBUG
org.apache.struts.chain.commands.ExceptionCatcher  - Calling
exceptionCommand 'servlet-exception'
21 Aug 2007 13:11:28,320  DEBUG
org.apache.struts.chain.commands.ActionCommandBase  - Executing
org.apache.struts.chain.commands.servlet.ExceptionHandler
21 Aug 2007 13:11:28,320  DEBUG
org.apache.struts.chain.commands.AbstractExceptionHandler  - See if
actionConfig
ActionConfig[cancellable=false,path=/divisas/verGraphExchRate,validate=t
rue,forward=verGraphExchRate.pantal