You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by JetWork <mo...@gmail.com> on 2009/01/15 11:41:07 UTC

Jetspeed 2 Unicode problem

In my Java file, I am declaring a field separator as following:

String fieldSeparator= "\u00a6"; (which is a broken bar)

When I access and print in JSP, it prints the following character ' ª '

But in log file it shows me the correct character i.e. broken bar.

Actually in jsp, i am using this character as field separator and in java i
am splitting the string on this particular character, In java i am able to
split, as it is treated as different character.

Why I am posting this issue in Jetspeed 2, because we have one other portal,
on that it is working perfectly.

-- 
View this message in context: http://www.nabble.com/Jetspeed-2-Unicode-problem-tp21475159p21475159.html
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed 2 Unicode problem

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Jan 20, 2009, at 3:28 AM, JetWork wrote:

>
> Hi,
>
> Thanks for reply.
>
> I am using JBoss 4.0.3SP1.
>
> Is there any setting specific to Jboss that i have to make, to get it
> working.
>


I don't use JBoss, so Im not much help there. I believe there is some  
minor security configuration unrelated to the problem you are having

Just to narrow down the problem, can you try your same portlet on  
Tomcat?
It shouldn't take long to test, just download the demo and drop your  
PA in

http://portals.apache.org/jetspeed-2/download.html


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed 2 Unicode problem

Posted by JetWork <mo...@gmail.com>.
Hi,

Thanks for reply.

I am using JBoss 4.0.3SP1.

Is there any setting specific to Jboss that i have to make, to get it
working.

Thanks



David Sean Taylor wrote:
> 
> I wrote a quick portlet to test. Kept things simple. The Java code,  
> process action:
> 
>   public void processAction(ActionRequest actionRequest,  
> ActionResponse actionResponse) throws PortletException, IOException
>      {
>          String tester = actionRequest.getParameter("tester");
>          if (tester != null)
>          {
>              System.out.println("tester = " + tester);
>              String [] values = tester.split("\u00a6");
>              System.out.println("values = " + values);
>          }
> 
> then my JSP:
> 
> <%
> String fieldSeparator= "\u00a6";
> %>
> 
>      <input type="hidden" name ="tester" id="tester" value="a< 
> %=fieldSeparator%>b<%=fieldSeparator%>c"/>
> 
> With the debugger, I can see that values is correctly split into 3  
> values, a, b, c.
> 
> I also tested this with Groovy, just to make sure:
> 
> groovy> String DELIM = "\u00a6";
> groovy> String x = "a" + DELIM + "b" + DELIM + "c";
> groovy> String []y = x.split(DELIM);
> 
> Result: ["a", "b", "c"]
> 
> So maybe we are using different web containers?
> Im on Tomcat 5.5.27
> 
> On Jan 17, 2009, at 10:22 AM, JetWork wrote:
> 
>>
>> I am using Jetspeed 2.1.3 version
>>
>> In Java file I am declaring field separator as:
>>
>> class TestVal
>> {
>> ..... <<code>>
>> public final static String separator= "\u00a6";
>>
>> .... <<code>>
>> }
>>
>> In JSP, I have declared page-encoding in page declarative as "UTF-8"
>>
>> In scriplets i am assigning this value to a String variable
>>
>> <%
>>
>> String fieldSeparator= TestVal.separator;
>>
>> %>
>>
>> Then I am using this fieldSeparator in my javascript when user  
>> clicks on
>> process button like
>>
>> <script type="text/javascript">
>> function addFieldSeparators()
>> {
>>     document.getElementById("txt1").value + <%=fieldSeparator%> +
>>     document.getElementById("txt2").value + <%=fieldSeparator%> +
>>     document.getElementById("txt3").value
>> }
>> </script>
>>
>> After submitting the form, i am using the following logic in the above
>> mentioned Java class i.e. TestVal
>>
>> class TestVal
>> {
>>
>> ..... <<code>>
>> public final static String separator= "\u00a6";
>>
>> .... <<code>>
>>  public void processValues(String s)
>>  {
>>      String [] values=s.split(TestVal.separator);
>>
>>  }
>> }
>>
>> I am facing problem while splitting the string, it is not splitting  
>> on the
>> basis of separator character (broken bar value 166) , when i try to  
>> use,
>> separator as "\\|" (this is keyboards pipe symbol i.e ascii 124),  
>> then it
>> works fine and i am able to split the string.
>>
>> Please suggest.
>> If you need files, i can upload the actual JSP and Java files.
>>
>> Thanks and regards
>>
>>
>> David Sean Taylor-2 wrote:
>>>
>>>
>>> On Jan 15, 2009, at 2:41 AM, JetWork wrote:
>>>
>>>>
>>>> In my Java file, I am declaring a field separator as following:
>>>>
>>>> String fieldSeparator= "\u00a6"; (which is a broken bar)
>>>>
>>>> When I access and print in JSP, it prints the following character '
>>>> ª '
>>>>
>>>> But in log file it shows me the correct character i.e. broken bar.
>>>>
>>>> Actually in jsp, i am using this character as field separator and in
>>>> java i
>>>> am splitting the string on this particular character, In java i am
>>>> able to
>>>> split, as it is treated as different character.
>>>>
>>>> Why I am posting this issue in Jetspeed 2, because we have one other
>>>> portal,
>>>> on that it is working perfectly.
>>>>
>>>
>>>
>>> What version of Jetspeed?
>>> Could you paste in the code you are using in Java to make the
>>> fileSeparator variable available to your JSP
>>> Seeing the JSP code could help as well
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>>> For additional commands, e-mail: jetspeed-user- 
>>> help@portals.apache.org
>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Jetspeed-2-Unicode-problem-tp21475159p21519189.html
>> Sent from the Jetspeed - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Jetspeed-2-Unicode-problem-tp21475159p21561383.html
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed 2 Unicode problem

Posted by David Sean Taylor <da...@bluesunrise.com>.
I wrote a quick portlet to test. Kept things simple. The Java code,  
process action:

  public void processAction(ActionRequest actionRequest,  
ActionResponse actionResponse) throws PortletException, IOException
     {
         String tester = actionRequest.getParameter("tester");
         if (tester != null)
         {
             System.out.println("tester = " + tester);
             String [] values = tester.split("\u00a6");
             System.out.println("values = " + values);
         }

then my JSP:

<%
String fieldSeparator= "\u00a6";
%>

     <input type="hidden" name ="tester" id="tester" value="a< 
%=fieldSeparator%>b<%=fieldSeparator%>c"/>

With the debugger, I can see that values is correctly split into 3  
values, a, b, c.

I also tested this with Groovy, just to make sure:

groovy> String DELIM = "\u00a6";
groovy> String x = "a" + DELIM + "b" + DELIM + "c";
groovy> String []y = x.split(DELIM);

Result: ["a", "b", "c"]

So maybe we are using different web containers?
Im on Tomcat 5.5.27

On Jan 17, 2009, at 10:22 AM, JetWork wrote:

>
> I am using Jetspeed 2.1.3 version
>
> In Java file I am declaring field separator as:
>
> class TestVal
> {
> ..... <<code>>
> public final static String separator= "\u00a6";
>
> .... <<code>>
> }
>
> In JSP, I have declared page-encoding in page declarative as "UTF-8"
>
> In scriplets i am assigning this value to a String variable
>
> <%
>
> String fieldSeparator= TestVal.separator;
>
> %>
>
> Then I am using this fieldSeparator in my javascript when user  
> clicks on
> process button like
>
> <script type="text/javascript">
> function addFieldSeparators()
> {
>     document.getElementById("txt1").value + <%=fieldSeparator%> +
>     document.getElementById("txt2").value + <%=fieldSeparator%> +
>     document.getElementById("txt3").value
> }
> </script>
>
> After submitting the form, i am using the following logic in the above
> mentioned Java class i.e. TestVal
>
> class TestVal
> {
>
> ..... <<code>>
> public final static String separator= "\u00a6";
>
> .... <<code>>
>  public void processValues(String s)
>  {
>      String [] values=s.split(TestVal.separator);
>
>  }
> }
>
> I am facing problem while splitting the string, it is not splitting  
> on the
> basis of separator character (broken bar value 166) , when i try to  
> use,
> separator as "\\|" (this is keyboards pipe symbol i.e ascii 124),  
> then it
> works fine and i am able to split the string.
>
> Please suggest.
> If you need files, i can upload the actual JSP and Java files.
>
> Thanks and regards
>
>
> David Sean Taylor-2 wrote:
>>
>>
>> On Jan 15, 2009, at 2:41 AM, JetWork wrote:
>>
>>>
>>> In my Java file, I am declaring a field separator as following:
>>>
>>> String fieldSeparator= "\u00a6"; (which is a broken bar)
>>>
>>> When I access and print in JSP, it prints the following character '
>>> ª '
>>>
>>> But in log file it shows me the correct character i.e. broken bar.
>>>
>>> Actually in jsp, i am using this character as field separator and in
>>> java i
>>> am splitting the string on this particular character, In java i am
>>> able to
>>> split, as it is treated as different character.
>>>
>>> Why I am posting this issue in Jetspeed 2, because we have one other
>>> portal,
>>> on that it is working perfectly.
>>>
>>
>>
>> What version of Jetspeed?
>> Could you paste in the code you are using in Java to make the
>> fileSeparator variable available to your JSP
>> Seeing the JSP code could help as well
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user- 
>> help@portals.apache.org
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Jetspeed-2-Unicode-problem-tp21475159p21519189.html
> Sent from the Jetspeed - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed 2 Unicode problem

Posted by JetWork <mo...@gmail.com>.
I am using Jetspeed 2.1.3 version

In Java file I am declaring field separator as:

class TestVal
{
..... <<code>>
public final static String separator= "\u00a6";

.... <<code>>
}

In JSP, I have declared page-encoding in page declarative as "UTF-8"

In scriplets i am assigning this value to a String variable

<%

String fieldSeparator= TestVal.separator;

%>

Then I am using this fieldSeparator in my javascript when user clicks on
process button like

<script type="text/javascript">
function addFieldSeparators()
{
     document.getElementById("txt1").value + <%=fieldSeparator%> +      
     document.getElementById("txt2").value + <%=fieldSeparator%> +
     document.getElementById("txt3").value          
}
</script>

After submitting the form, i am using the following logic in the above
mentioned Java class i.e. TestVal

class TestVal
{

..... <<code>>
public final static String separator= "\u00a6"; 

.... <<code>>
  public void processValues(String s)
  {
      String [] values=s.split(TestVal.separator);

  }
}

I am facing problem while splitting the string, it is not splitting on the
basis of separator character (broken bar value 166) , when i try to use,
separator as "\\|" (this is keyboards pipe symbol i.e ascii 124), then it
works fine and i am able to split the string.

Please suggest.
If you need files, i can upload the actual JSP and Java files.

Thanks and regards


David Sean Taylor-2 wrote:
> 
> 
> On Jan 15, 2009, at 2:41 AM, JetWork wrote:
> 
>>
>> In my Java file, I am declaring a field separator as following:
>>
>> String fieldSeparator= "\u00a6"; (which is a broken bar)
>>
>> When I access and print in JSP, it prints the following character '  
>> ª '
>>
>> But in log file it shows me the correct character i.e. broken bar.
>>
>> Actually in jsp, i am using this character as field separator and in  
>> java i
>> am splitting the string on this particular character, In java i am  
>> able to
>> split, as it is treated as different character.
>>
>> Why I am posting this issue in Jetspeed 2, because we have one other  
>> portal,
>> on that it is working perfectly.
>>
> 
> 
> What version of Jetspeed?
> Could you paste in the code you are using in Java to make the  
> fileSeparator variable available to your JSP
> Seeing the JSP code could help as well
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Jetspeed-2-Unicode-problem-tp21475159p21519189.html
Sent from the Jetspeed - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed 2 Unicode problem

Posted by David Sean Taylor <dt...@onehippo.com>.
On Jan 15, 2009, at 2:41 AM, JetWork wrote:

>
> In my Java file, I am declaring a field separator as following:
>
> String fieldSeparator= "\u00a6"; (which is a broken bar)
>
> When I access and print in JSP, it prints the following character '  
> ª '
>
> But in log file it shows me the correct character i.e. broken bar.
>
> Actually in jsp, i am using this character as field separator and in  
> java i
> am splitting the string on this particular character, In java i am  
> able to
> split, as it is treated as different character.
>
> Why I am posting this issue in Jetspeed 2, because we have one other  
> portal,
> on that it is working perfectly.
>


What version of Jetspeed?
Could you paste in the code you are using in Java to make the  
fileSeparator variable available to your JSP
Seeing the JSP code could help as well


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org