You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by luna_guo <gh...@163.com> on 2008/09/28 11:32:03 UTC

How to set response encoding?

I have a page that required using GBK encoding.
I have the following line in the template file:
<meta http-equiv="Content-Type" content="text/html;charset=GBK" />
but in the browser,the page still display with UTF-8.


-- 
View this message in context: http://www.nabble.com/How-to-set-response-encoding--tp19710060p19710060.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: War file deploy problem on remote server

Posted by Marinus Maris <ma...@magiad.nl>.
Thanks for your answers. Yes indeed the solution is to create a new 
Maven project (I use Netbeans), call it ROOT. Copy the src directory of 
the project you wanted to deploy but didn't work into the src dir of 
this new project. Now create the ROOT.war and dump that into the appBase 
directory. I also have the ROOT.xml in the conf/Catalina subdir, with 
content:
<?xml version="1.0" encoding="UTF-8"?>
<Context path=""/>

This works and that's all I wanted.

Thanks and regards

Marinus Maris


Norman Franke schreef:
> I've successfully deployed to the root using Tomcat. I just created 
> ROOT.war and dropped it in the webapps directory. It seemed to work 
> without any configuration changes.
>
> Norman Franke
> Answering Service for Directors, Inc.
> www.myasd.com
>
> On Sep 29, 2008, at 1:27 PM, Jonathan Barker wrote:
>
>>
>> It depends.  I had a similar frustrating experience on my own system 
>> (Tomcat
>> on Debian) getting a war deployed in the root context.
>>
>> Depending on the system's configuration, there's the ROOT.xml 
>> descriptor, a
>> ROOT.war somewhere, possibly an override for the ROOT.xml in a 
>> /etc/tomcat
>> directory.
>>
>> Anywhere you look, be sure you distinguish between actual files and 
>> links.
>>
>> I assume you are trying to use the root context - sometimes the easiest
>> answer is to replace the stock ROOT.war with your own application.
>>
>> Have fun!
>>
>>
>>> -----Original Message-----
>>> From: Marinus Maris [mailto:marinus.maris@magiad.nl]
>>> Sent: Monday, September 29, 2008 12:34
>>> To: Tapestry users
>>> Subject: War file deploy problem on remote server
>>>
>>> Hi,
>>>
>>> OK, I got my Tapestry application to run on my local machine. Now I 
>>> want
>>> to deploy on a web server. But whatever I do, it seems that I cannot 
>>> set
>>> similar setting at that remote machine (the system manager over 
>>> there is
>>> getting nuts as wel). I either get a white page, or, when I get the
>>> Start page, it cannot find any other page, because it adds "myapp" to
>>> the path of the url. As a result, I get no where.
>>>
>>> As far as I get it, we have to do:
>>> 1. The mlwizz.war file. This needs to uploaded to the directory
>>> indicated by the "appBase" from server.xml.
>>> 2. In the directory conf/Catalina/myname.com/ there we have to add the
>>> context path to the war file. In my local machine I see a Root.xml. But
>>> this does not seems to work for the remote machine. What is the name of
>>> this xml file? (Root or myapp) and what is the context path?
>>>
>>> These are my server.xml settings:
>>> <Host name="mlwizz.com"
>>>  appBase="/home/web82d/domains/myname.com/tomcat" unpackWARs="true"
>>> autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
>>> <Context path="/manager" debug="0" privileged="true"
>>> docBase="/home/web82d/tomcat/tomcat/webapps/manager">
>>> </Context>
>>> <Context path="/docs" debug="0" privileged="true"
>>> docBase="/home/web82d/tomcat/tomcat/webapps/docs">
>>> </Context>
>>> </Host>
>>>
>>> Thanks for any help
>>>
>>> Marinus
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: War file deploy problem on remote server

Posted by Norman Franke <no...@myasd.com>.
I've successfully deployed to the root using Tomcat. I just created  
ROOT.war and dropped it in the webapps directory. It seemed to work  
without any configuration changes.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Sep 29, 2008, at 1:27 PM, Jonathan Barker wrote:

>
> It depends.  I had a similar frustrating experience on my own system  
> (Tomcat
> on Debian) getting a war deployed in the root context.
>
> Depending on the system's configuration, there's the ROOT.xml  
> descriptor, a
> ROOT.war somewhere, possibly an override for the ROOT.xml in a /etc/ 
> tomcat
> directory.
>
> Anywhere you look, be sure you distinguish between actual files and  
> links.
>
> I assume you are trying to use the root context - sometimes the  
> easiest
> answer is to replace the stock ROOT.war with your own application.
>
> Have fun!
>
>
>> -----Original Message-----
>> From: Marinus Maris [mailto:marinus.maris@magiad.nl]
>> Sent: Monday, September 29, 2008 12:34
>> To: Tapestry users
>> Subject: War file deploy problem on remote server
>>
>> Hi,
>>
>> OK, I got my Tapestry application to run on my local machine. Now I  
>> want
>> to deploy on a web server. But whatever I do, it seems that I  
>> cannot set
>> similar setting at that remote machine (the system manager over  
>> there is
>> getting nuts as wel). I either get a white page, or, when I get the
>> Start page, it cannot find any other page, because it adds "myapp" to
>> the path of the url. As a result, I get no where.
>>
>> As far as I get it, we have to do:
>> 1. The mlwizz.war file. This needs to uploaded to the directory
>> indicated by the "appBase" from server.xml.
>> 2. In the directory conf/Catalina/myname.com/ there we have to add  
>> the
>> context path to the war file. In my local machine I see a Root.xml.  
>> But
>> this does not seems to work for the remote machine. What is the  
>> name of
>> this xml file? (Root or myapp) and what is the context path?
>>
>> These are my server.xml settings:
>> <Host name="mlwizz.com"
>>  appBase="/home/web82d/domains/myname.com/tomcat" unpackWARs="true"
>> autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
>> <Context path="/manager" debug="0" privileged="true"
>> docBase="/home/web82d/tomcat/tomcat/webapps/manager">
>> </Context>
>> <Context path="/docs" debug="0" privileged="true"
>> docBase="/home/web82d/tomcat/tomcat/webapps/docs">
>> </Context>
>> </Host>
>>
>> Thanks for any help
>>
>> Marinus
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: War file deploy problem on remote server

Posted by Jonathan Barker <jo...@gmail.com>.
It depends.  I had a similar frustrating experience on my own system (Tomcat
on Debian) getting a war deployed in the root context.

Depending on the system's configuration, there's the ROOT.xml descriptor, a
ROOT.war somewhere, possibly an override for the ROOT.xml in a /etc/tomcat
directory.

Anywhere you look, be sure you distinguish between actual files and links.

I assume you are trying to use the root context - sometimes the easiest
answer is to replace the stock ROOT.war with your own application.

Have fun!


> -----Original Message-----
> From: Marinus Maris [mailto:marinus.maris@magiad.nl]
> Sent: Monday, September 29, 2008 12:34
> To: Tapestry users
> Subject: War file deploy problem on remote server
> 
> Hi,
> 
> OK, I got my Tapestry application to run on my local machine. Now I want
> to deploy on a web server. But whatever I do, it seems that I cannot set
> similar setting at that remote machine (the system manager over there is
> getting nuts as wel). I either get a white page, or, when I get the
> Start page, it cannot find any other page, because it adds "myapp" to
> the path of the url. As a result, I get no where.
> 
> As far as I get it, we have to do:
> 1. The mlwizz.war file. This needs to uploaded to the directory
> indicated by the "appBase" from server.xml.
> 2. In the directory conf/Catalina/myname.com/ there we have to add the
> context path to the war file. In my local machine I see a Root.xml. But
> this does not seems to work for the remote machine. What is the name of
> this xml file? (Root or myapp) and what is the context path?
> 
> These are my server.xml settings:
> <Host name="mlwizz.com"
>   appBase="/home/web82d/domains/myname.com/tomcat" unpackWARs="true"
> autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
> <Context path="/manager" debug="0" privileged="true"
> docBase="/home/web82d/tomcat/tomcat/webapps/manager">
> </Context>
> <Context path="/docs" debug="0" privileged="true"
> docBase="/home/web82d/tomcat/tomcat/webapps/docs">
> </Context>
> </Host>
> 
> Thanks for any help
> 
> Marinus
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


War file deploy problem on remote server

Posted by Marinus Maris <ma...@magiad.nl>.
Hi,

OK, I got my Tapestry application to run on my local machine. Now I want 
to deploy on a web server. But whatever I do, it seems that I cannot set 
similar setting at that remote machine (the system manager over there is 
getting nuts as wel). I either get a white page, or, when I get the 
Start page, it cannot find any other page, because it adds "myapp" to 
the path of the url. As a result, I get no where.

As far as I get it, we have to do:
1. The mlwizz.war file. This needs to uploaded to the directory 
indicated by the "appBase" from server.xml.
2. In the directory conf/Catalina/myname.com/ there we have to add the 
context path to the war file. In my local machine I see a Root.xml. But 
this does not seems to work for the remote machine. What is the name of 
this xml file? (Root or myapp) and what is the context path?

These are my server.xml settings:
<Host name="mlwizz.com" 
  appBase="/home/web82d/domains/myname.com/tomcat" unpackWARs="true" 
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Context path="/manager" debug="0" privileged="true"
docBase="/home/web82d/tomcat/tomcat/webapps/manager">
</Context>
<Context path="/docs" debug="0" privileged="true"
docBase="/home/web82d/tomcat/tomcat/webapps/docs">
</Context>
</Host>

Thanks for any help

Marinus



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to set response encoding?

Posted by luna_guo <gh...@163.com>.
This dosn't work for me.


Harald Geritzer-2 wrote:
> 
>> Unfortunately this settings will affect the whole application. I
>> wonder if there's a way to set charset only for specific pages.
> 
> @Meta(value = {"tapestry.response-content-type=text/html",
> "tapestry.response-encoding=GBK"})
> public class MyPage {
> 
>    ...
> }
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-response-encoding--tp19710060p19711257.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to set response encoding?

Posted by Jecki <je...@gmail.com>.
On Sun, Sep 28, 2008 at 6:51 PM, Harald Geritzer <h....@gmail.com> wrote:
>> Unfortunately this settings will affect the whole application. I
>> wonder if there's a way to set charset only for specific pages.
>
> @Meta(value = {"tapestry.response-content-type=text/html",
> "tapestry.response-encoding=GBK"})
> public class MyPage {
>

I'm not sure why, but the 'tapestry.response-encoding' didn't work for
me. OTOH the 'tapestry.response-content-type' works great.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to set response encoding?

Posted by Harald Geritzer <h....@gmail.com>.
> Unfortunately this settings will affect the whole application. I
> wonder if there's a way to set charset only for specific pages.

@Meta(value = {"tapestry.response-content-type=text/html", "tapestry.response-encoding=GBK"})
public class MyPage {

   ...
}


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to set response encoding?

Posted by Jecki <je...@gmail.com>.
Hi,

After a quick search over tapestry codebase I found this configuration
key 'tapestry.charset'. It can be used to specify your designated
charset. Just add a 'context-param' entry in web.xml, something looks
sort like this:

  <context-param>
    <param-name>tapestry.charset</param-name>
    <param-value>GBK</param-value>
  </context-param>

Unfortunately this settings will affect the whole application. I
wonder if there's a way to set charset only for specific pages.

On Sun, Sep 28, 2008 at 5:32 PM, luna_guo <gh...@163.com> wrote:
>
> I have a page that required using GBK encoding.
> I have the following line in the template file:
> <meta http-equiv="Content-Type" content="text/html;charset=GBK" />
> but in the browser,the page still display with UTF-8.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org