You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "Nils-Helge Garli (JIRA)" <ji...@apache.org> on 2008/02/01 14:27:13 UTC

[jira] Created: (PLUTO-464) toString in PortalUrlParserImpl is not idempotent

toString in PortalUrlParserImpl is not idempotent
-------------------------------------------------

                 Key: PLUTO-464
                 URL: https://issues.apache.org/jira/browse/PLUTO-464
             Project: Pluto
          Issue Type: Bug
          Components: portal driver
    Affects Versions: 2.0.0
            Reporter: Nils-Helge Garli
            Priority: Blocker


toString in PortalUrlParserImpl changes to the actual parameter values in the PortalURL it tries to encode. If a parameter in the url contains a special character that needs to be encoded, the value is decoded in the array itself, updating the reference to the actual encoded value. 



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: pluto-1.1.5 : String encoding is changing when jsp is included

Posted by CD...@hannaford.com.

Hi Naresh,
Try setting the charset init-param for PortalDriverServlet in web.xml as
described here: https://issues.apache.org/jira/browse/PLUTO-446 .
/Craig





                                                                           
             "Naresh Shorey"                                               
             <Naresh@mwh.gov.b                                             
             h>                                                         To 
                                       <pl...@portals.apache.org>      
             06/03/2008 06:51                                           cc 
             AM                                                            
                                                                   Subject 
                                       pluto-1.1.5 : String encoding is    
             Please respond to         changing when jsp is included       
             pluto-dev@portals                                             
                .apache.org                                                
                                                                           
                                                                           
                                                                           
                                                                           




Any help to resolve this issue is most welcome.

I created a small HelloWorldPortlet which includes a jsp page

             public class HelloWorldPortlet extends GenericPortlet {
                 protected void doView(RenderRequest request,
                                       RenderResponse response) throws
PortletException,

IOException {
                     response.setContentType("text/html; charset=UTF-8");

//this.getPortletContext().getRequestDispatcher("/greet").include(request,
response);

this.getPortletContext().getRequestDispatcher("/msg.jsp").include(request,
response);
                 }
             }
The jsp page msg.jsp outputs a string in unicode:
             <%@ page contentType="text/html;charset=UTF-8"%>
             <p>Hello Portlet.
             <% String s = "\u0645\u0631\u062d\u0628\u0627"; %>
             <br/>Printing Unicode from jsp : <%=s%>
             <br/>
             <% out.println("file.encoding = " +
System.getProperty("file.encoding")); %>
             </p>

I am using Pluto-1.1.5 as driver to render the portlet and the unicode
string is not being displayed as expected. The String is text in Arabic
language. It seems that Pluto is converting the string to Cp1252 encoding.

The same text is rendered fine if we include a servlet which outputs this
text instead of a jsp.
             public class Greet extends HttpServlet {
                 private static final String CONTENT_TYPE = "text/html;
charset=UTF-8";
                 public void init(ServletConfig config) throws
ServletException {
                     super.init(config);
                 }

                 public void doGet(HttpServletRequest request,
                                   HttpServletResponse response) throws
ServletException, IOException              {

response.setContentType(CONTENT_TYPE);
                     PrintWriter out = response.getWriter();
                     out.println("Printing Unicode from servlet : " +
"\u0627\u0646\u062a\u0647\u0627\u0621");
                     out.close();
                 }
             }



Best Regards,

Naresh Shorey



pluto-1.1.5 : String encoding is changing when jsp is included

Posted by Naresh Shorey <Na...@mwh.gov.bh>.
Any help to resolve this issue is most welcome.

I created a small HelloWorldPortlet which includes a jsp page

	public class HelloWorldPortlet extends GenericPortlet {
	    protected void doView(RenderRequest request, 
      	                    RenderResponse response) throws PortletException, 
	                                                          IOException {
	        response.setContentType("text/html; charset=UTF-8");
	        //this.getPortletContext().getRequestDispatcher("/greet").include(request, response);
		  this.getPortletContext().getRequestDispatcher("/msg.jsp").include(request, response);
	    }
	}
The jsp page msg.jsp outputs a string in unicode:
	<%@ page contentType="text/html;charset=UTF-8"%>
	<p>Hello Portlet. 
	<% String s = "\u0645\u0631\u062d\u0628\u0627"; %>
	<br/>Printing Unicode from jsp : <%=s%>
	<br/>
	<% out.println("file.encoding = " + System.getProperty("file.encoding")); %>
	</p>

I am using Pluto-1.1.5 as driver to render the portlet and the unicode string is not being displayed as expected. The String is text in Arabic language. It seems that Pluto is converting the string to Cp1252 encoding.

The same text is rendered fine if we include a servlet which outputs this text instead of a jsp.
	public class Greet extends HttpServlet {
	    private static final String CONTENT_TYPE = "text/html; charset=UTF-8";
	    public void init(ServletConfig config) throws ServletException {
	        super.init(config);
	    }
	
	    public void doGet(HttpServletRequest request, 
	                      HttpServletResponse response) throws ServletException, IOException 	{						  response.setContentType(CONTENT_TYPE);
	        PrintWriter out = response.getWriter();
	        out.println("Printing Unicode from servlet : " + "\u0627\u0646\u062a\u0647\u0627\u0621");
	        out.close();
	    }
	}



Best Regards,

Naresh Shorey

[jira] Closed: (PLUTO-464) toString in PortalUrlParserImpl is not idempotent

Posted by "Craig Doremus (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PLUTO-464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Doremus closed PLUTO-464.
-------------------------------

    Resolution: Fixed

Applied patch resolves issue

> toString in PortalUrlParserImpl is not idempotent
> -------------------------------------------------
>
>                 Key: PLUTO-464
>                 URL: https://issues.apache.org/jira/browse/PLUTO-464
>             Project: Pluto
>          Issue Type: Bug
>          Components: portal driver
>    Affects Versions: 2.0.0
>            Reporter: Nils-Helge Garli
>            Priority: Blocker
>         Attachments: PortalURLParserImplTest.java, toString.patch
>
>
> toString in PortalUrlParserImpl changes to the actual parameter values in the PortalURL it tries to encode. If a parameter in the url contains a special character that needs to be encoded, the value is decoded in the array itself, updating the reference to the actual encoded value. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PLUTO-464) toString in PortalUrlParserImpl is not idempotent

Posted by "Torsten Dettborn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PLUTO-464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565297#action_12565297 ] 

Torsten Dettborn commented on PLUTO-464:
----------------------------------------

Applied toString.patch. The new rev number is 618220.

> toString in PortalUrlParserImpl is not idempotent
> -------------------------------------------------
>
>                 Key: PLUTO-464
>                 URL: https://issues.apache.org/jira/browse/PLUTO-464
>             Project: Pluto
>          Issue Type: Bug
>          Components: portal driver
>    Affects Versions: 2.0.0
>            Reporter: Nils-Helge Garli
>            Priority: Blocker
>         Attachments: PortalURLParserImplTest.java, toString.patch
>
>
> toString in PortalUrlParserImpl changes to the actual parameter values in the PortalURL it tries to encode. If a parameter in the url contains a special character that needs to be encoded, the value is decoded in the array itself, updating the reference to the actual encoded value. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PLUTO-464) toString in PortalUrlParserImpl is not idempotent

Posted by "Nils-Helge Garli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PLUTO-464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nils-Helge Garli updated PLUTO-464:
-----------------------------------

    Attachment: PortalURLParserImplTest.java

Unit test to reproduce the error

> toString in PortalUrlParserImpl is not idempotent
> -------------------------------------------------
>
>                 Key: PLUTO-464
>                 URL: https://issues.apache.org/jira/browse/PLUTO-464
>             Project: Pluto
>          Issue Type: Bug
>          Components: portal driver
>    Affects Versions: 2.0.0
>            Reporter: Nils-Helge Garli
>            Priority: Blocker
>         Attachments: PortalURLParserImplTest.java
>
>
> toString in PortalUrlParserImpl changes to the actual parameter values in the PortalURL it tries to encode. If a parameter in the url contains a special character that needs to be encoded, the value is decoded in the array itself, updating the reference to the actual encoded value. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PLUTO-464) toString in PortalUrlParserImpl is not idempotent

Posted by "Nils-Helge Garli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PLUTO-464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nils-Helge Garli updated PLUTO-464:
-----------------------------------

    Attachment: toString.patch

Patch to solve the issue.

> toString in PortalUrlParserImpl is not idempotent
> -------------------------------------------------
>
>                 Key: PLUTO-464
>                 URL: https://issues.apache.org/jira/browse/PLUTO-464
>             Project: Pluto
>          Issue Type: Bug
>          Components: portal driver
>    Affects Versions: 2.0.0
>            Reporter: Nils-Helge Garli
>            Priority: Blocker
>         Attachments: PortalURLParserImplTest.java, toString.patch
>
>
> toString in PortalUrlParserImpl changes to the actual parameter values in the PortalURL it tries to encode. If a parameter in the url contains a special character that needs to be encoded, the value is decoded in the array itself, updating the reference to the actual encoded value. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.