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 Veronica Padrón <ve...@gmail.com> on 2006/06/20 11:29:47 UTC

How Can I change the encoding in Jetspeed 2.0

I´ve a problem with jetspeed 2.0, because I cannot change the encoding to ISO-
8859-1

I had changed the jetspeed.properties, and include the line:
content.defaultencoding=ISO-8859-1

I had changed the velocity.properties, and include the lines:
template.encoding=iso-8859-1
input.encoding =iso-8859-1

and nothing......

the encoding of my pages is UTF-8

Please, something can I help me????






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


Re: How Can I change the encoding in Jetspeed 2.0

Posted by Aaron Evans <aa...@gmail.com>.
On 6/22/06, Veronica Padrón <ve...@gmail.com> wrote:
> 2.- I don´t find varios methods, like the method getHeader().
> My portletrequest or actionrequest don´t have this method.
>  (In HttpServletRequest this methods exists, but in portlet api ???)
>

There is a very good reason for this.  I suggest you read the portlet
spec in order to understand the difference between the portlet and
servlet APIs:

http://www.jcp.org/aboutJava/communityprocess/final/jsr168/

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


Re: How Can I change the encoding in Jetspeed 2.0

Posted by Veronica Padrón <ve...@gmail.com>.
Thank you very much David. I tried it but I had severals problem:

1.- The first and must important problems is that I´m new in JetSpeed.

2.- I don´t find varios methods, like the method getHeader().
My portletrequest or actionrequest don´t have this method.
 (In HttpServletRequest this methods exists, but in portlet api ???)

3.- I put im my path (in eclipse) the next jar file:
jetspeed-capabilities-2.0.jar but I don´t find the class CapabilityMap.

4.- And the last is a question: is posible that I can change the value
of encoding in MEDIA_TYPE table?
if is yes... the questions if obvious for me 
remember I´m new in JetSpeed):like??? 
(I must install derby and next use ij to connect with
this database...
Probably productiondb??? I don´t know... sorry David

very very very  Thank you.




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


Re: How Can I change the encoding in Jetspeed 2.0

Posted by Veronica Padrón <ve...@gmail.com>.
David Sean Taylor <david <at> bluesunrise.com> writes:

> 
> Veronica Padrón wrote:
> > I´ve a problem with jetspeed 2.0, because I cannot change the encoding to 
ISO-
> > 8859-1
> > 
> > I had changed the jetspeed.properties, and include the line:
> > content.defaultencoding=ISO-8859-1
> > 
> This is no longer used
> 
> > I had changed the velocity.properties, and include the lines:
> > template.encoding=iso-8859-1
> > input.encoding =iso-8859-1
> > 
> > and nothing......
> > 
> > the encoding of my pages is UTF-8
> > 
> > Please, something can I help me????
> > 
> Take a look at the CapabilitiesValveImpl:
> 
>         String agent = request.getRequest().getHeader("User-Agent");
> 
>          // Get capability map
>          CapabilityMap cm = capabilities.getCapabilityMap(agent);
>          MediaType mediaType = cm.getPreferredMediaType();
>          MimeType mimeType = cm.getPreferredType();
> 
>          String encoding = request.getRequest().getCharacterEncoding();
> 
> ....
> 
>          String encoding = request.getRequest().getCharacterEncoding();
> 
>          if (encoding == null)
>          {
>              if (mediaType != null && mediaType.getCharacterSet() != null)
>              {
>                  encoding = mediaType.getCharacterSet();
>              }
>          }
> 
> Most likely, you are getting your encoding from the Jetspeed 
> Capabilities settings, coming from MEDIA_TYPE table data
> 
I tried it, but I don´t manage it to resolve.
I cannot implements the solution of David Sean Taylor, so I decided to try 
severals things:
1.- I have make a ServletFilter to change the encoding, I declared it in the 
web.xml of my portlet aplication, but nothing.
2.- I changed the ../webapps/jetspeed/WEB-INF/jetspeed-macros.vm and I modified 
the macro ContentType to put then charset to ISO-8859-1. With this solution in 
my browser (Mozilla) I can see the information of my page and the meta-tag 
content is correct, but the codification is UTF-8.
In this moment if I save my page with mozilla (p.e. in my desktop) and then 
open it (with mozilla) the codification is correct (ISO-8859-1). (I supose that 
the server send in the header the incorrect charset).

Not that to do

Please something can I help me......

Thank you very much.

   





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


Re: How Can I change the encoding in Jetspeed 2.0

Posted by David Sean Taylor <da...@bluesunrise.com>.
Veronica Padrón wrote:
> I´ve a problem with jetspeed 2.0, because I cannot change the encoding to ISO-
> 8859-1
> 
> I had changed the jetspeed.properties, and include the line:
> content.defaultencoding=ISO-8859-1
> 
This is no longer used

> I had changed the velocity.properties, and include the lines:
> template.encoding=iso-8859-1
> input.encoding =iso-8859-1
> 
> and nothing......
> 
> the encoding of my pages is UTF-8
> 
> Please, something can I help me????
> 
Take a look at the CapabilitiesValveImpl:

        String agent = request.getRequest().getHeader("User-Agent");

         // Get capability map
         CapabilityMap cm = capabilities.getCapabilityMap(agent);
         MediaType mediaType = cm.getPreferredMediaType();
         MimeType mimeType = cm.getPreferredType();

         String encoding = request.getRequest().getCharacterEncoding();

....

         String encoding = request.getRequest().getCharacterEncoding();

         if (encoding == null)
         {
             if (mediaType != null && mediaType.getCharacterSet() != null)
             {
                 encoding = mediaType.getCharacterSet();
             }
         }


Most likely, you are getting your encoding from the Jetspeed 
Capabilities settings, coming from MEDIA_TYPE table data



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