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: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
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: [email protected]
For additional commands, e-mail: [email protected]