Problem with Stripes:param

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with Stripes:param

Nahid Seidi
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Nestor Hernandez

Hi, I think this problem is related to encoding. You can try a Servlet filter mapped to /*  and call the methods setCharacterEncoding("UTF-8") of HttpServletResponse and HttpServletRequest

El feb 26, 2015 6:29 PM, "Nahid Seidi" <[hidden email]> escribió:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Rick Grashel
In reply to this post by Nahid Seidi
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Nahid Seidi
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

VANKEISBELCK Remi
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Gérald Quintana
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <[hidden email]>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Nahid Seidi
Hi Gérald

I'm using Resin. I guess I need to find out how to do the configuration you sent in resin.

/Nahid

On Friday, February 27, 2015, Gérald Quintana <[hidden email]> wrote:
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;remi@rvkb.com&#39;);" target="_blank">remi@...>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;nahid.seidi@gmail.com&#39;);" target="_blank">nahid.seidi@...>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;rgrashel@gmail.com&#39;);" target="_blank">rgrashel@...> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;nahid.seidi@gmail.com&#39;);" target="_blank">nahid.seidi@...> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Stripes-users@lists.sourceforge.net&#39;);" target="_blank">Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Stripes-users@lists.sourceforge.net&#39;);" target="_blank">Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Stripes-users@lists.sourceforge.net&#39;);" target="_blank">Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Stripes-users@lists.sourceforge.net&#39;);" target="_blank">Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Nahid Seidi
Thank you everyone for your answers. I added the following in web.xml and it works now! But it's also weird to me how Spring MVC affects on encoding!

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
    <filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
  </filter-mapping>

/Nahid

On Fri, Feb 27, 2015 at 11:52 AM, Nahid Seidi <[hidden email]> wrote:
Hi Gérald

I'm using Resin. I guess I need to find out how to do the configuration you sent in resin.

/Nahid


On Friday, February 27, 2015, Gérald Quintana <[hidden email]> wrote:
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <[hidden email]>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

VANKEISBELCK Remi
Glad it works.

Look at the sources : it probably forces request/response encoding by calling  :

Cheers

Rémi 

2015-02-27 13:15 GMT+01:00 Nahid Seidi <[hidden email]>:
Thank you everyone for your answers. I added the following in web.xml and it works now! But it's also weird to me how Spring MVC affects on encoding!

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
    <filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
  </filter-mapping>

/Nahid

On Fri, Feb 27, 2015 at 11:52 AM, Nahid Seidi <[hidden email]> wrote:
Hi Gérald

I'm using Resin. I guess I need to find out how to do the configuration you sent in resin.

/Nahid


On Friday, February 27, 2015, Gérald Quintana <[hidden email]> wrote:
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <[hidden email]>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Rick Grashel
In reply to this post by Nahid Seidi
Nahid,

Ah, good find by everyone that your server isn't in UTF-8.  

If you are using Resin, just put this in your resin configuration file: 

<character-encoding>utf-8</character-encoding>

That should fix the issue without the need for a filter.

-- Rick


On Fri, Feb 27, 2015 at 6:15 AM, Nahid Seidi <[hidden email]> wrote:
Thank you everyone for your answers. I added the following in web.xml and it works now! But it's also weird to me how Spring MVC affects on encoding!

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
    <filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
  </filter-mapping>

/Nahid

On Fri, Feb 27, 2015 at 11:52 AM, Nahid Seidi <[hidden email]> wrote:
Hi Gérald

I'm using Resin. I guess I need to find out how to do the configuration you sent in resin.

/Nahid


On Friday, February 27, 2015, Gérald Quintana <[hidden email]> wrote:
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <[hidden email]>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Nahid Seidi
Rick,

You're right! It works without doing any filter mapped.

Thanks!
/Nahid

On Fri, Feb 27, 2015 at 1:48 PM, Rick Grashel <[hidden email]> wrote:
Nahid,

Ah, good find by everyone that your server isn't in UTF-8.  

If you are using Resin, just put this in your resin configuration file: 

<character-encoding>utf-8</character-encoding>

That should fix the issue without the need for a filter.

-- Rick


On Fri, Feb 27, 2015 at 6:15 AM, Nahid Seidi <[hidden email]> wrote:
Thank you everyone for your answers. I added the following in web.xml and it works now! But it's also weird to me how Spring MVC affects on encoding!

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
    <filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
  </filter-mapping>

/Nahid

On Fri, Feb 27, 2015 at 11:52 AM, Nahid Seidi <[hidden email]> wrote:
Hi Gérald

I'm using Resin. I guess I need to find out how to do the configuration you sent in resin.

/Nahid


On Friday, February 27, 2015, Gérald Quintana <[hidden email]> wrote:
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <[hidden email]>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

VANKEISBELCK Remi
Nahid,

The servlet filter makes your app portable without any server config required. I'd keep the filter if I were you.

That's why it's included in almost every framework out there. We could add this as a core functionality into Stripes dispatching : it's easy, and quite the recurrent feature.

Cheers

Rémi

2015-02-27 14:10 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

You're right! It works without doing any filter mapped.

Thanks!
/Nahid

On Fri, Feb 27, 2015 at 1:48 PM, Rick Grashel <[hidden email]> wrote:
Nahid,

Ah, good find by everyone that your server isn't in UTF-8.  

If you are using Resin, just put this in your resin configuration file: 

<character-encoding>utf-8</character-encoding>

That should fix the issue without the need for a filter.

-- Rick


On Fri, Feb 27, 2015 at 6:15 AM, Nahid Seidi <[hidden email]> wrote:
Thank you everyone for your answers. I added the following in web.xml and it works now! But it's also weird to me how Spring MVC affects on encoding!

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
    <filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
  </filter-mapping>

/Nahid

On Fri, Feb 27, 2015 at 11:52 AM, Nahid Seidi <[hidden email]> wrote:
Hi Gérald

I'm using Resin. I guess I need to find out how to do the configuration you sent in resin.

/Nahid


On Friday, February 27, 2015, Gérald Quintana <[hidden email]> wrote:
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <[hidden email]>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Rusty Wright-2
In reply to this post by Rick Grashel
What are the disadvantages of always having the server configured for UTF-8?

On Fri, Feb 27, 2015 at 4:48 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

Ah, good find by everyone that your server isn't in UTF-8.  

If you are using Resin, just put this in your resin configuration file: 

<character-encoding>utf-8</character-encoding>

That should fix the issue without the need for a filter.

-- Rick


On Fri, Feb 27, 2015 at 6:15 AM, Nahid Seidi <[hidden email]> wrote:
Thank you everyone for your answers. I added the following in web.xml and it works now! But it's also weird to me how Spring MVC affects on encoding!

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
    <filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
  </filter-mapping>

/Nahid

On Fri, Feb 27, 2015 at 11:52 AM, Nahid Seidi <[hidden email]> wrote:
Hi Gérald

I'm using Resin. I guess I need to find out how to do the configuration you sent in resin.

/Nahid


On Friday, February 27, 2015, Gérald Quintana <[hidden email]> wrote:
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <[hidden email]>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Rick Grashel

Rusty, there really aren't any. It depends on your perspective. Personally, I think some low level things and services are better to be handed by the application server. Default character encoding is one of those. It all depends on how you view a container and the services you think it should and shouldn't provide to applications.

-- Rick

On Feb 27, 2015 12:40 PM, "Rusty Wright" <[hidden email]> wrote:
What are the disadvantages of always having the server configured for UTF-8?

On Fri, Feb 27, 2015 at 4:48 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

Ah, good find by everyone that your server isn't in UTF-8.  

If you are using Resin, just put this in your resin configuration file: 

<character-encoding>utf-8</character-encoding>

That should fix the issue without the need for a filter.

-- Rick


On Fri, Feb 27, 2015 at 6:15 AM, Nahid Seidi <[hidden email]> wrote:
Thank you everyone for your answers. I added the following in web.xml and it works now! But it's also weird to me how Spring MVC affects on encoding!

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
    <filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
  </filter-mapping>

/Nahid

On Fri, Feb 27, 2015 at 11:52 AM, Nahid Seidi <[hidden email]> wrote:
Hi Gérald

I'm using Resin. I guess I need to find out how to do the configuration you sent in resin.

/Nahid


On Friday, February 27, 2015, Gérald Quintana <[hidden email]> wrote:
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <[hidden email]>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Stripes:param

Rusty Wright-2
Ok, thanks.  Googling brought up this answer as to why it's not using UTF-8.

http://wiki.apache.org/tomcat/FAQ/CharacterEncoding

On Fri, Feb 27, 2015 at 10:49 AM, Rick Grashel <[hidden email]> wrote:

Rusty, there really aren't any. It depends on your perspective. Personally, I think some low level things and services are better to be handed by the application server. Default character encoding is one of those. It all depends on how you view a container and the services you think it should and shouldn't provide to applications.

-- Rick

On Feb 27, 2015 12:40 PM, "Rusty Wright" <[hidden email]> wrote:
What are the disadvantages of always having the server configured for UTF-8?

On Fri, Feb 27, 2015 at 4:48 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

Ah, good find by everyone that your server isn't in UTF-8.  

If you are using Resin, just put this in your resin configuration file: 

<character-encoding>utf-8</character-encoding>

That should fix the issue without the need for a filter.

-- Rick


On Fri, Feb 27, 2015 at 6:15 AM, Nahid Seidi <[hidden email]> wrote:
Thank you everyone for your answers. I added the following in web.xml and it works now! But it's also weird to me how Spring MVC affects on encoding!

<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
    <filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
  </filter-mapping>

/Nahid

On Fri, Feb 27, 2015 at 11:52 AM, Nahid Seidi <[hidden email]> wrote:
Hi Gérald

I'm using Resin. I guess I need to find out how to do the configuration you sent in resin.

/Nahid


On Friday, February 27, 2015, Gérald Quintana <[hidden email]> wrote:
Hello,

If you're using Tomcat:

Gérald


2015-02-27 11:07 GMT+01:00 VANKEISBELCK Remi <[hidden email]>:
Hi,

I'd say Nestor is right. You app server is probably using platform locale.

You probably want this kind of filter :

And configure it to use utf-8.

Cheers

Rémi


2015-02-27 9:42 GMT+01:00 Nahid Seidi <[hidden email]>:
Rick,

I already tried the encoding tag, but it doesn't work. As I said, I don't think the problem is with encoding because as you see in the first jsp I get 'fname' form an actionbean and then send that to another one. Since 'fname' is shown correctly in first jsp but not in second jsp so I don't think it is about encoding. I wonder if there is another way to pass parameters (fname, lname) to the other jsp using something other than stripes:param ?



On Fri, Feb 27, 2015 at 1:11 AM, Rick Grashel <[hidden email]> wrote:
Nahid,

I've never had a problem with encoding the contents of a parameter.  Try again with this at the very top of your JSP or the very top of your stripes template:

<%@ page contentType="text/html; charset=UTF-8" %>

Thanks.

-- Rick

On Thu, Feb 26, 2015 at 5:27 PM, Nahid Seidi <[hidden email]> wrote:
Hi

I am sending some variables from stripes:param to another actionbean in order to show them in another jsp file. The problem is that if a variable has non-english characters like (ä,ö,...) stripes:param encode them to some wired format. I used ecoding tags in my jsp but doesn't work. Since stripes:param is inside a stripes:link, could it be something with stripes:link? For example if 'fname' in first jsp has a character like 'ö' stripes converts it to some other characters when it shows it in second jsp! I don't think it's about encoding, because the characters are shown correctly in first jsp but when I pass them using stripes:param they're changed somehow!

first jsp

<stripes:link beanclass="se.theducation.course.ui.action.student.StudentEditExcelAction" event="loadStudent" >
    <stripes:param name="fname" value="${array.getStudent().getFirstName() }" />
    <stripes:param name="lname" value="${array.getStudent().getLastName() }" />
    edit
</stripes:link>

StudentEditExcelAction.java

@UrlBinding("/Student/editExcel.action")
public class StudentEditExcelAction implements ActionBean {

private String fname;
private String lname;

@DefaultHandler
@DontValidate
public Resolution edit() {
    return forward("editExcel");
}

@DontValidate
public Resolution loadStudent() {
    System.out.println("utbildare: " + school); //TODO delete this later
    return forward("editExcel");
}

second jsp

<table class="solid" style="margin-top: 5px; padding: 5px; width:900px">
    <tr class="solid">
        <td class="solid">
            <tags:labeled label="Firstname:"><br />
            <stripes:text name="fname"/>
            </tags:labeled>
        </td>
        <td class="solid">
            <tags:labeled label="Lastname:"><br />
            <stripes:text name="lname"/>
            </tags:labeled>
        </td>
    </tr>
</table>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users