You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ahmet temiz <ah...@gmail.com> on 2011/02/25 19:37:06 UTC

what to do in conf. files

hello

Are there anythings I have to do in configuration files to
change from development stages to production stage ?

Especially, what are things to deploy jsf_webapp
 in its real host after developing it in the localhost  ?

kind regards


-- 
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı
Bilgi ve CBS grubu
Eskişehir Yolu 10. km.
Lodumlu / Ankara
Tel : 0 312 2872680 / 1535

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


Re: request.getParameter() not working in Tomcat 7.0.8

Posted by Michael McCutcheon <mi...@att.net>.
On 2/26/2011 10:43 PM, Michael McCutcheon wrote:
> I've got a simple problem where:
>
> request.getQueryString() returns this:
>
> "title%3Dtesttitle%26categoryAccessLabel%3Dtestcategoryaccesslabel%26valueAccessLabel%3DtestvalueAccessLabel" 
>
>
> but request.getParameter("title") returns null.
>
> Am I missing something obvious?
>
> Shouldn't it be returning 'testtitle'?
>
> thanks,
> Mike
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Sorry...I did not mean to do a reply message.


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


Re: request.getParameter() not working in Tomcat 7.0.8

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/2/27 Mark Thomas <ma...@apache.org>:
> On 27/02/2011 16:14, André Warnier wrote:
>> markt@apache.org wrote:
>> ...
>>
>>>
>>> What you are missing is that query parameters and values are parsed
>>> before %nn decoding so the names and values can contain reserved
>>> characters.
>>>
>> Mark,
>> are you sure ?
>

Sure. Otherwise how are you going to pass "=" in a value?

That is about parameters and the query string. The %nn sequences in
path are decoded elsewhere (in a different step).

> I may be talking nonsense - it was early when I typed that. Lets
> continue this in the non-hijacked thread.

Best regards,
Konstantin Kolinko

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


Re: request.getParameter() not working in Tomcat 7.0.8

Posted by Mark Thomas <ma...@apache.org>.
On 27/02/2011 16:14, André Warnier wrote:
> markt@apache.org wrote:
> ...
> 
>>
>> What you are missing is that query parameters and values are parsed
>> before %nn decoding so the names and values can contain reserved
>> characters.
>>
> Mark,
> are you sure ?

I may be talking nonsense - it was early when I typed that. Lets
continue this in the non-hijacked thread.

Mark

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


Re: request.getParameter() not working in Tomcat 7.0.8

Posted by André Warnier <aw...@ice-sa.com>.
markt@apache.org wrote:
...

> 
> What you are missing is that query parameters and values are parsed before %nn decoding so the names and values can contain reserved characters.
> 
Mark,
are you sure ?

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


Re: request.getParameter() not working in Tomcat 7.0.8

Posted by ma...@apache.org.
Michael McCutcheon <mi...@att.net> wrote:

>I've got a simple problem where:
>
>request.getQueryString() returns this:
>
>"title%3Dtesttitle%26categoryAccessLabel%3Dtestcategoryaccesslabel%26valueAccessLabel%3DtestvalueAccessLabel"
>
>but request.getParameter("title") returns null.
>
>Am I missing something obvious?
>
>Shouldn't it be returning 'testtitle'?
>
>thanks,
>Mike
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org

What you are missing is that query parameters and values are parsed before %nn decoding so the names and values can contain reserved characters.

Mark



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


request.getParameter() not working in Tomcat 7.0.8

Posted by Michael McCutcheon <mi...@att.net>.
I've got a simple problem where:

request.getQueryString() returns this:

"title%3Dtesttitle%26categoryAccessLabel%3Dtestcategoryaccesslabel%26valueAccessLabel%3DtestvalueAccessLabel"

but request.getParameter("title") returns null.

Am I missing something obvious?

Shouldn't it be returning 'testtitle'?

thanks,
Mike


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


Re: what to do in conf. files

Posted by Ognjen Blagojevic <og...@gmail.com>.
On 26.2.2011 22:29, Ognjen Blagojevic wrote:
> 3. Remove the reloadable attribute. Docs: "This feature is very useful
> during application development, but it requires significant runtime
> overhead and is not recommended for use on deployed production
> applications. That's why the default setting for this attribute is
> false. You can use the Manager web application, however, to trigger
> reloads of deployed applications on demand."

I mean: remove this aatribute in your production context.xml.

-Ognjen

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


Re: what to do in conf. files

Posted by Ognjen Blagojevic <og...@gmail.com>.
On 26.2.2011 18:50, ahmet temiz wrote:
> <?xml version="1.0" encoding="UTF-8"?>
> <Context path="/usr/local/workspace1/pro1" docBase="pro1"
> 	crossContext="true" reloadable="true" debug="1">
> 	<Resource name="jdbc/bzk2" auth="Container" type="javax.sql.DataSource"
> 		driverClassName="org.postgresql.Driver"
> url="jdbc:postgresql://127.0.0.1:5432/bzk2"
> 		username="orkun" password="222222" maxActive="20" maxIdle="10"
> poolPreparedStatements="true"
> 		maxWait="-1" accessToUnderlyingConnectionAllowed="true" />
> </Context>

1. Remove the path attribute. Docs: "The value of this field must not be 
set except when statically defining a Context in server.xml, as it will 
be inferred from the filenames used for either the .xml context file or 
the docBase."

2. Remove the docBase attribute. Docs: "The value of this field must not 
be set when the Context is configured using a META-INF/context.xml file 
as it will be inferred by the automatic deployment process."

3. Remove the reloadable attribute. Docs: "This feature is very useful 
during application development, but it requires significant runtime 
overhead and is not recommended for use on deployed production 
applications. That's why the default setting for this attribute is 
false. You can use the Manager web application, however, to trigger 
reloads of deployed applications on demand."

4. Remove debug attribute. Docs: "". It is deprecated.

5. If "222222" is actual password, change it. I advise you to remove 
passwords from the examples you post, since you make them visible to the 
world-wide audince.

Also, if your DB parameters at development and production are different 
(which is recommended), you will need two context.xml files, and a 
proper script to pack the right one into the WAR archive.

-Ognjen


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


Re: what to do in conf. files

Posted by ahmet temiz <ah...@gmail.com>.
Thank you for your interest.

when I went over my app., something looked suspicious.

I had added an extra context file for pooled postgresql connection
like this:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/usr/local/workspace1/pro1" docBase="pro1"
	crossContext="true" reloadable="true" debug="1">
	<Resource name="jdbc/bzk2" auth="Container" type="javax.sql.DataSource"
		driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://127.0.0.1:5432/bzk2"
		username="orkun" password="222222" maxActive="20" maxIdle="10"
poolPreparedStatements="true"
		maxWait="-1" accessToUnderlyingConnectionAllowed="true" />
</Context>

Is it likely to be the reason of problem ? especially this expression
url="jdbc:postgresql://127.0.0.1:5432/bzk2" in production stage.

kind regards



2011/2/25 Christopher Schultz <ch...@christopherschultz.net>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ahmet,
>
> On 2/25/2011 1:37 PM, ahmet temiz wrote:
>> Are there anythings I have to do in configuration files to
>> change from development stages to production stage ?
>
> Unless you've done foolish things in development, production
> configuration should not really need any changes. Some things you might
> consider changing for a production configuration:
>
> 1. Set larger number of request processors in <Connector>
> 2. Set <Host> autoDeploy="false"
> 3. Set JspServlet parameters:
>   - development
>   - modificationTestInterval
>   - checkInterval
> 4. Change the number of db connections in a JNDI DataSource
>   (I always use max=1 in dev, so production should clearly have more)
>
>> Especially, what are things to deploy jsf_webapp
>>  in its real host after developing it in the localhost  ?
>
> You will also have to make sure that your URLs are built properly. If
> the string "localhost" appears anywhere in your webapp, you're probbaly
> doing something wrong. Also, if you're not building URLs in pages like this:
>
>   <a href="<%= response.encodeURL(request.getContextPath()
>                          + "/path/to/resource") %>">your link</a>
>
> ...then you are probably going to have problems re-locating it. Note
> that the use of tag libraries for building URLs is generally a good idea
> because this complexity is hidden from you.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk1oCOwACgkQ9CaO5/Lv0PCyGgCgts7HKVsGPoprtSm7ceNQSBdU
> 0r8AnRwk1uMwyNU0r+6HyUh3iwQf3rUd
> =Zx0H
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>



-- 
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı
Bilgi ve CBS grubu
Eskişehir Yolu 10. km.
Lodumlu / Ankara
Tel : 0 312 2872680 / 1535

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


Re: what to do in conf. files

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To whom it mat concern,

On 2/25/2011 2:57 PM, spring@gmx.eu wrote:
>>> Especially, what are things to deploy jsf_webapp
>>>  in its real host after developing it in the localhost  ?
>>
>> You will also have to make sure that your URLs are built properly. If
>> the string "localhost" appears anywhere in your webapp, 
>> you're probbaly
>> doing something wrong. Also, if you're not building URLs in 
>> pages like this:
>>
>>    <a href="<%= response.encodeURL(request.getContextPath()
>>                           + "/path/to/resource") %>">your link</a>
> 
> Isn't this very, very old Java-mixed-with-JSP code style?

Yes, which is why I mentioned the use of tag libraries.

Since everybody and their brother uses their own tag library, I figured
I'd not confuse the issue by giving examples from Struts 1.0/1.1/1.2,
Struts 2, JSTL 1.0/1.1/1.2, etc.

The OP didn't give any information about his environment (other than
"JSF"), so he could be running almost anything. The nice part about what
I've written above is that it will work under any JSP environment
regardless of version or available tag libraries.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1oC7gACgkQ9CaO5/Lv0PD67gCeIYE0xoq6oF5kmIGmtek/4TjQ
YikAnRhwr+0A/r1VNgx/CF39a8raT5fj
=d7PQ
-----END PGP SIGNATURE-----

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


RE: what to do in conf. files

Posted by sp...@gmx.eu.
> > Especially, what are things to deploy jsf_webapp
> >  in its real host after developing it in the localhost  ?
> 
> You will also have to make sure that your URLs are built properly. If
> the string "localhost" appears anywhere in your webapp, 
> you're probbaly
> doing something wrong. Also, if you're not building URLs in 
> pages like this:
> 
>    <a href="<%= response.encodeURL(request.getContextPath()
>                           + "/path/to/resource") %>">your link</a>

Isn't this very, very old Java-mixed-with-JSP code style?


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


Re: what to do in conf. files

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ahmet,

On 2/25/2011 1:37 PM, ahmet temiz wrote:
> Are there anythings I have to do in configuration files to
> change from development stages to production stage ?

Unless you've done foolish things in development, production
configuration should not really need any changes. Some things you might
consider changing for a production configuration:

1. Set larger number of request processors in <Connector>
2. Set <Host> autoDeploy="false"
3. Set JspServlet parameters:
   - development
   - modificationTestInterval
   - checkInterval
4. Change the number of db connections in a JNDI DataSource
   (I always use max=1 in dev, so production should clearly have more)

> Especially, what are things to deploy jsf_webapp
>  in its real host after developing it in the localhost  ?

You will also have to make sure that your URLs are built properly. If
the string "localhost" appears anywhere in your webapp, you're probbaly
doing something wrong. Also, if you're not building URLs in pages like this:

   <a href="<%= response.encodeURL(request.getContextPath()
                          + "/path/to/resource") %>">your link</a>

...then you are probably going to have problems re-locating it. Note
that the use of tag libraries for building URLs is generally a good idea
because this complexity is hidden from you.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1oCOwACgkQ9CaO5/Lv0PCyGgCgts7HKVsGPoprtSm7ceNQSBdU
0r8AnRwk1uMwyNU0r+6HyUh3iwQf3rUd
=Zx0H
-----END PGP SIGNATURE-----

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