from apache-tomcat-7.0.54 to apache-tomcat-7.0.78 performance issues

2017-06-20 Thread Alireza Fattahi
We switched from apache-tomcat-7.0.54 to apache-tomcat-7.0.78, after that we 
face slow loading if the site, even site first page

We are using tomcat datasource.
We did not change any application or tomcat parameter during this upgrade.


Any comments? ~Regards,
~~Alireza Fattahi

Reloading

2013-08-19 Thread Alireza Fattahi
Hi, 
I am using Tomcat 6.0. The context is set to autoreload.
When I change the JSP the pages are publish and the context are not restart.
When I change the java files the context is restarting .
I am using struts 2 framework and extending its template framework. The 
new template files, which are base on freemaker, should be stored in 
WEB-INF\classes\template\myNewTemplate
Here is the problem when I change one of these freemaker files, the tomcat 
restarts the context! 
Is
 it because this file is under WEB-INF\classes? If yes, can
 I configure tomcat to ignore the changes in this folder?


~Regards,
~~Alireza Fattahi 

Re: JSP in Static Resources

2013-07-15 Thread Alireza Fattahi
Hi,

I am using YAML framework for layout management, it has lot's of css files to 
be changed, and on the other hand, if I want to set the contentType manually I 
should do it every time I upgrade the YAML framework. 
  

~Regards,
~~Alireza Fattahi



 From: Leon Rosenberg rosenberg.l...@gmail.com
To: Tomcat Users List users@tomcat.apache.org; Alireza Fattahi 
afatt...@yahoo.com 
Sent: Monday, 15 July 2013, 4:44
Subject: Re: JSP in Static Resources
 


Hello Alireza,

what exactly was wrong with putting 
contentType=text/css;charset=UTF-8

on top of your css-jsps?
Actually each page should have content-type, so why not the css jsps?

Leon




On Sun, Jul 14, 2013 at 12:43 PM, Alireza Fattahi afatt...@yahoo.com wrote:

Well,
 
If we want to follow up that post , then we should belive that:
Setting the mime type is not working for css
So
we should use other ways to solve it.
 
Is that true?!  

~Regards,
~~Alireza Fattahi



From: André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Sunday, 14 July 2013, 12:00

Subject: Re: JSP in Static Resources



Alireza Fattahi wrote:
 Guys please concentrate on the main issue !!

I believe that the main issue was already answered thoroughly by Konstantin 
earlier.
Did you not read it ?


 I ask again:

 When you set jsp servlet to process the css files by adding:
 servlet-mapping
    servlet-namejsp/servlet-name
    url-pattern*.css/url-pattern
 /servlet-mapping


 The tomcat does not set the CSS file extension mime type to text/css. 
 Although below line is set in localhost-config/web.xml

    mime-mapping
        extensioncss/extension
        mime-typetext/css/mime-type
    /mime-mapping


 When you manually set the content mime type %@page contentType=text/css 
 % every thing will work fine


 ~Regards,
 ~~Alireza Fattahi


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

Re: JSP in Static Resources

2013-07-15 Thread Alireza Fattahi
Good point, I did not think about it !

Please let me know this:
If I have an static html page ( like and about.html page) and I change the 
extension to  to jsp (about.js) , then the tomcat will not cache it any more?!

I try to google tomcat caching and could not find any thing useful.
Can you please give me some references about caching?


~Regards,
~~Alireza Fattahi



 From: Tim Watts t...@cliftonfarm.org
To: Tomcat Users List users@tomcat.apache.org 
Sent: Monday, 15 July 2013, 3:23
Subject: Re: JSP in Static Resources
 

On Sun, 2013-07-14 at 23:28 +0200, André Warnier wrote:
 Alireza Fattahi wrote:
  Well,
   
  If we want to follow up that post , then we should belive that:
 
 Tomcat is an inclusive church, and you can believe what you want.
 Konstantin is one of the Tomcat developers however, so you should
 probably consider what he wrote and try to understand it correctly.
 
  Setting the mime type is not working for css
 
 That is not what he wrote.
 
 Setting the MIME type in (tomcat)/conf/web.xml /does/ work, for the
 default servlet which is used by default in all webapps to serve
 static documents. But in the case of the logic which you want to
 implement, the CSS is not a static document, so it is not relevant to
 your specific case.
 
 He gave you the proper syntax for Tomcat 7, because previously you did
 not mention the Tomcat version that you were using.
 
 For Tomcat 6, that syntax doesn't work.

  So
  we should use other ways to solve it.
 
 Yes. The first option would be to use Tomcat 7 instead of Tomcat 6.
 Then the syntax shown by Konstantin would work.
 
 Otherwise, he gave you one hint of how to try to solve it.
 
 Another possibility would be to wrap your webapp with a servlet
 filter, and set the content-type header there, before the content is
 written to the response object.
 
 Another possibility would be to re-think your logic, and leave you CSS
 files be static documents, and just pick the one you need to include.
 
 That you want or don't want to use a certain logic is your choice; but
 if you pick a logic which is difficult to implement in the version of
 the software that you are using, then the problem to implement it is
 ultimately yours.

Another drawback to generating the CSS files dynamically is that you'll
have to do extra work to make them cacheable.  But when served as static
resources, the default servlet does a good job of this for you.  If you
don't take steps to make them cacheable, they'll be fetched every time
on every page adding extra load on your server and the network.

 
 
   
  Is that true?!  
  ~Regards,
  ~~Alireza Fattahi
  
  
  
  From: André Warnier a...@ice-sa.com
  To: Tomcat Users List users@tomcat.apache.org 
  Sent: Sunday, 14 July 2013, 12:00
  Subject: Re: JSP in Static Resources
  
  
  Alireza Fattahi wrote:
  Guys please concentrate on the main issue !!
  
  I believe that the main issue was already answered thoroughly by 
  Konstantin earlier.
  Did you not read it ?
  
  I ask again:
 
  When you set jsp servlet to process the css files by adding:
  servlet-mapping
      servlet-namejsp/servlet-name
      url-pattern*.css/url-pattern
  /servlet-mapping
 
 
  The tomcat does not set the CSS file extension mime type to text/css. 
  Although below line is set in localhost-config/web.xml
 
      mime-mapping
          extensioncss/extension
          mime-typetext/css/mime-type
      /mime-mapping
 
 
  When you manually set the content mime type %@page contentType=text/css 
  % every thing will work fine
 
 
  ~Regards,
  ~~Alireza Fattahi
  
  
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

Re: JSP in Static Resources

2013-07-15 Thread Alireza Fattahi
Thanks for help!

Let me summarize:

There are two servlets as below:
1- Default servlet which process all static resources
2- jsp servlet which process the JSP file

The mime types ( which are defined in localhost-config/web.xml) are only used 
bydefault servlet.


When I ask the jsp servlet to process the .css files, this servlet will always 
set the MIME to text/html.

So this problem could be solved  if the servlet mapping has something like 
mime-type as below:
servlet-mapping
    servlet-namejsp/servlet-name
    url-pattern*.css/url-pattern
   mime-typetext/css/mime-type
/servlet-mapping
I should ask jcp.org to put this in next servlet jsr !!


So, may be I try to write a servlet to set the content type.
Do you know if tomcat has a build in filter or servlet for that.
Some thing like: org.apache.catalina.filters.SetCharacterEncodingFilter which 
sets the encoding 
    

 
~Regards,
~~Alireza Fattahi



 From: André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Monday, 15 July 2013, 1:58
Subject: Re: JSP in Static Resources
 

Alireza Fattahi wrote:
 Well,
  
 If we want to follow up that post , then we should belive that:

Tomcat is an inclusive church, and you can believe what you want.
Konstantin is one of the Tomcat developers however, so you should probably 
consider what 
he wrote and try to understand it correctly.

 Setting the mime type is not working for css

That is not what he wrote.

Setting the MIME type in (tomcat)/conf/web.xml /does/ work, for the default 
servlet which 
is used by default in all webapps to serve static documents.
But in the case of the logic which you want to implement, the CSS is not a 
static 
document, so it is not relevant to your specific case.

He gave you the proper syntax for Tomcat 7, because previously you did not 
mention the 
Tomcat version that you were using.

For Tomcat 6, that syntax doesn't work.


 So
 we should use other ways to solve it.

Yes. The first option would be to use Tomcat 7 instead of Tomcat 6.
Then the syntax shown by Konstantin would work.

Otherwise, he gave you one hint of how to try to solve it.

Another possibility would be to wrap your webapp with a servlet filter, and set 
the 
content-type header there, before the content is written to the response object.

Another possibility would be to re-think your logic, and leave you CSS files be 
static 
documents, and just pick the one you need to include.

That you want or don't want to use a certain logic is your choice; but if you 
pick a logic 
which is difficult to implement in the version of the software that you are 
using, then 
the problem to implement it is ultimately yours.



  
 Is that true?!  
 ~Regards,
 ~~Alireza Fattahi
 
 
 
 From: André Warnier a...@ice-sa.com
 To: Tomcat Users List users@tomcat.apache.org 
 Sent: Sunday, 14 July 2013, 12:00
 Subject: Re: JSP in Static Resources
 
 
 Alireza Fattahi wrote:
 Guys please concentrate on the main issue !!
 
 I believe that the main issue was already answered thoroughly by Konstantin 
 earlier.
 Did you not read it ?
 
 I ask again:

 When you set jsp servlet to process the css files by adding:
 servlet-mapping
     servlet-namejsp/servlet-name
     url-pattern*.css/url-pattern
 /servlet-mapping


 The tomcat does not set the CSS file extension mime type to text/css. 
 Although below line is set in localhost-config/web.xml

     mime-mapping
         extensioncss/extension
         mime-typetext/css/mime-type
     /mime-mapping


 When you manually set the content mime type %@page contentType=text/css 
 % every thing will work fine


 ~Regards,
 ~~Alireza Fattahi
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


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

Re: JSP in Static Resources

2013-07-15 Thread Alireza Fattahi


 
~Regards,
~~Alireza Fattahi



 From: André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Monday, 15 July 2013, 12:09
Subject: Re: JSP in Static Resources
 

Alireza Fattahi wrote:
 Good point, I did not think about it !


What is a good point ?
*** Considering the caching which I forget about it!
That is what Konstantin meant, when he asked you to not top post.
If you comment or answer questions on top of your message, then someone has to 
scroll down 
the message and try to figure out to what your comment relates, or what 
question you are 
answering.  Many people won't bother.

Insert your answers directly below the question/comment to which it relates, 
please.
** I do not prefer this way and find that lots of posts do not send emails 
this way.
** As, it makes the thread hard to understand, after three or four post.
** But you are the boss !

 Please let me know this:
 If I have an static html page ( like and about.html page) and I change the 
 extension to  to jsp (about.js) , then the tomcat will not cache it any more?!

Wrong explanation. It has nothing to do with the extension.
* So how tomcat finds which resources are static ?!
The point is : it is only possible to cache a *static* document. That is true 
at the 
server level, and at the browser level.  If a document is generated 
dynamically, using 
some code, then the caching logic has no way to determine if this thing changes 
from one 
call to the next, and thus caching previous responses is useless.
A response generated by a JSP (whether it is HTML, CSS or anything else) is 
dynamic by 
nature, and cannot/should not be cached.
 That is my point too. Where this logic is defined ?! is it hard coded ? 
 How tomcat find if some request is static and could be cached.
 For example request to http://localhost/mysite/contact.pdf will be cached 
at server or not !
 How can I find it ?!


In other words, the very subject of this thread does not really make sense : if 
you add 
Java code into a static resource and thus make it into a JSP, it is not static 
anymore.


You can probably find a way to trick the caching mechanisms into believing 
that a 
dynamic response is static.  But then you will create severe problems in the 
usage of your 
application, because clients will start using outdated versions of the pages, 
instead of 
the correct ones.
 Still looking for some reference documents about tomcat caching 
configuration !
 Thanks for your help!

 I try to google tomcat caching and could not find any thing useful.
 Can you please give me some references about caching?
 
 
 ~Regards,
 ~~Alireza Fattahi
 
 
 
  From: Tim Watts t...@cliftonfarm.org
 To: Tomcat Users List users@tomcat.apache.org 
 Sent: Monday, 15 July 2013, 3:23
 Subject: Re: JSP in Static Resources
  
 
 On Sun, 2013-07-14 at 23:28 +0200, André Warnier wrote:
 Alireza Fattahi wrote:
 Well,
  
 If we want to follow up that post , then we should belive that:
 Tomcat is an inclusive church, and you can believe what you want.
 Konstantin is one of the Tomcat developers however, so you should
 probably consider what he wrote and try to understand it correctly.

 Setting the mime type is not working for css
 That is not what he wrote.

 Setting the MIME type in (tomcat)/conf/web.xml /does/ work, for the
 default servlet which is used by default in all webapps to serve
 static documents. But in the case of the logic which you want to
 implement, the CSS is not a static document, so it is not relevant to
 your specific case.

 He gave you the proper syntax for Tomcat 7, because previously you did
 not mention the Tomcat version that you were using.

 For Tomcat 6, that syntax doesn't work.
 
 So
 we should use other ways to solve it.
 Yes. The first option would be to use Tomcat 7 instead of Tomcat 6.
 Then the syntax shown by Konstantin would work.

 Otherwise, he gave you one hint of how to try to solve it.

 Another possibility would be to wrap your webapp with a servlet
 filter, and set the content-type header there, before the content is
 written to the response object.

 Another possibility would be to re-think your logic, and leave you CSS
 files be static documents, and just pick the one you need to include.

 That you want or don't want to use a certain logic is your choice; but
 if you pick a logic which is difficult to implement in the version of
 the software that you are using, then the problem to implement it is
 ultimately yours.
 
 Another drawback to generating the CSS files dynamically is that you'll
 have to do extra work to make them cacheable.  But when served as static
 resources, the default servlet does a good job of this for you.  If you
 don't take steps to make them cacheable, they'll be fetched every time
 on every page adding extra load on your server and the network.
 

  
 Is that true?!  
 ~Regards,
 ~~Alireza Fattahi

Re: [OT] JSP in Static Resources

2013-07-15 Thread Alireza Fattahi


 ~Regards,
 ~~Alireza Fattahi
 
 
 
  From: André Warnier a...@ice-sa.com
 To: Tomcat Users List users@tomcat.apache.org 
 Sent: Monday, 15 July 2013, 12:09
 Subject: Re: JSP in Static Resources
  
 
 Alireza Fattahi wrote:
 Good point, I did not think about it !

 
 What is a good point ?
 *** Considering the caching which I forget about it!
 That is what Konstantin meant, when he asked you to not top post.
 If you comment or answer questions on top of your message, then someone has 
 to scroll down 
 the message and try to figure out to what your comment relates, or what 
 question you are 
 answering.  Many people won't bother.
 
 Insert your answers directly below the question/comment to which it relates, 
 please.
 ** I do not prefer this way and find that lots of posts do not send 
 emails this way.
 ** As, it makes the thread hard to understand, after three or four post.
 ** But you are the boss !

It is not that I am the boss (which I am not), it is that these are the rules 
of this 
Tomcat users list.
The people who are *donating* their time here to answer your questions, prefer 
it that 
way.  Independently of your own preferences or what other lists do, you should 
respect 
that, if you ask the people here for their time in resolving your issues.
That is just basic politeness.
*** Thanks for *donating* your time !

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

Re: JSP in Static Resources

2013-07-15 Thread Alireza Fattahi

 
~Regards,
~~Alireza Fattahi



 From: André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Monday, 15 July 2013, 14:13
Subject: Re: JSP in Static Resources
 

Alireza Fattahi wrote:
 Thanks for help!
 
 Let me summarize:
 
 There are two servlets as below:
 1- Default servlet which process all static resources
 2- jsp servlet which process the JSP file

yes.

 
 The mime types ( which are defined in localhost-config/web.xml) are only used 
 bydefault servlet.
 

Yes, but you should remove the parenthesis.

 
 When I ask the jsp servlet to process the .css files, this servlet will 
 always set the MIME to text/html.

By default, yes, the JSP servlet sets the content-type to HTML.
This is a *default*, and it is chosen this way to save precious programmer 
keystrokes to 
state the content-type explicitly, for the majority of cases (because 
overwhelmingly, JSP 
pages usually return HTML content).
So it belongs to the programmer to explicitly specify the content-type, it it 
does not 
match the default.  This is the case for *any non-HTML* content, whether it is 
CSS, 
Javascript, images or whatever.

 
 So this problem could be solved  if the servlet mapping has something like 
 mime-type as below:
 servlet-mapping
     servlet-namejsp/servlet-name
     url-pattern*.css/url-pattern
    mime-typetext/css/mime-type
 /servlet-mapping

Yes, but you should realise that this is syntactic sugar : it saves some 
keystrokes for 
the programmer, at the cost of making the server more bloated.
Just like for standard HTML, each page should contain an indication of what 
it's content is.

 I should ask jcp.org to put this in next servlet jsr !!
 
See Mark's answer.

 
 So, may be I try to write a servlet to set the content type.
 Do you know if tomcat has a build in filter or servlet for that.
 Some thing like: org.apache.catalina.filters.SetCharacterEncodingFilter which 
 sets the encoding 

See Mark's answer.


Alireza, (hoping that this is your first name)
 Yes André  my name is Alireza !!
basically my own opinion is :
Your idea of incorporating Java code into the CSS pages, to achieve what you 
want, is 
clever, and it is technically possible.  But the fact that it is clever and 
technically 
possible does not mean that you should necessarily do it that way.  That way of 
doing it, 
in my view, has a number of disadvantages which more than compensate for the 
cleverness : 
it would not work under all versions of all servers, it does not allow caching 
of the CSS 
files, it makes it more difficult to understand and maintain the pages of your 
website, 
and it makes things so that your CSS pages are not really pure CSS pages 
anymore. It also 
makes it so that each time your server will serve a CSS page, it will have to 
run a few 
tens of thousands of additional CPU cycles, compared to having the CSS files as 
pure 
static documents. And it willhave to do this more often, because they are not 
static 
anymore and will not be cached by the browsers and/or server.
I would not do it that way, and I would try to apply the cleverness somewhere 
else.  You 
have the real JSP pages of your site, which /must/ already be compiled and 
executed 
via the JSP process anyway.  One additional instruction in these pages is not 
going to 
make a big difference.  But making the CSS pages go from being static to being 
dynamic is 
a big difference, with a series of side-effects now and in the future that are 
difficult 
to predict.

But it's your application and your choice.

* Thanks for your comments
* I already see sites that do this. 
* For example please visit these three sites:
* http://en.wikipedia.org/wiki/Apache_Tomcat
* View source
* link rel=stylesheet 
href=//bits.wikimedia.org/en.wikipedia.org/load.php?debug=falseamp;lang=enamp;modules=ext.gadget.DRN-wizard%2CReferenceTooltips%2Ccharinsert%2Cteahouse%7Cext.rtlcite%2Cwikihiero%7Cext.uls.nojs%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmw.PopUpMediaTransform%7Cskins.vectoramp;only=stylesamp;skin=vectoramp;*
 /
* the load.php makes a dynamic css

* Please visit www.ebay.com
* View source
* link 
href=http://gh.ebaystatic.com/header/css/all.min?combo=11ds=3siteid=0rvr=93h=22235;
 type=text/css rel=stylesheet
** the all.min loads dynamic css

** Even facebook uses dynamic css.

** Do you think I am wrong ?

** All these site are multilinguala and bidirectional sites. This is the 
case which force them
** make the css files generate dynamically.
** When you work on these types of sites there is always a trade off to 
make some thing like this:
** mysite/style/fa_IR/style.css
** mysite/styles/en_US/style.css
** mysite/styles/ar_AU/style.css
** or making one css and try put if statements in it.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

Re: JSP in Static Resources

2013-07-14 Thread Alireza Fattahi
Well,
 
If we want to follow up that post , then we should belive that:
Setting the mime type is not working for css
So
we should use other ways to solve it.
 
Is that true?!  
~Regards,
~~Alireza Fattahi



From: André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Sunday, 14 July 2013, 12:00
Subject: Re: JSP in Static Resources


Alireza Fattahi wrote:
 Guys please concentrate on the main issue !!

I believe that the main issue was already answered thoroughly by Konstantin 
earlier.
Did you not read it ?

 
 I ask again:
 
 When you set jsp servlet to process the css files by adding:
 servlet-mapping
    servlet-namejsp/servlet-name
    url-pattern*.css/url-pattern
 /servlet-mapping
 
 
 The tomcat does not set the CSS file extension mime type to text/css. 
 Although below line is set in localhost-config/web.xml
 
    mime-mapping
        extensioncss/extension
        mime-typetext/css/mime-type
    /mime-mapping
 
 
 When you manually set the content mime type %@page contentType=text/css % 
 every thing will work fine
 
 
 ~Regards,
 ~~Alireza Fattahi


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

JSP in Static Resources

2013-07-13 Thread Alireza Fattahi
Hi,

I want to add some jsp code in to my site.css.

So, as this is a static resource I add below to my web.xml and ask tomcat to 
compile it as a jsp.
    servlet-mapping
    servlet-namejsp/servlet-name
    url-pattern*.css/url-pattern
    /servlet-mapping


When I view the site in firefox it shows an error which says:
[11:46:41.547] The stylesheet site.css was not loaded because its MIME type, 
text/html, is not text/css. @ chrome://fdm_ffext/content/fdm_brcache.js:86

 
I have added below to web.xml
    mime-mapping
    extensioncss/extension
    mime-typetext/css/mime-type
    /mime-mapping    

It did not helped. The site pages link to css as below:
link href=/styles/site.css   rel=stylesheet type=text/css /


When I remove the servlet mapping and mime-mapping everything works fine. So I 
believe the mime type is not set correctly for css files.
Any comments ?!


~Regards,
~~Alireza Fattahi

Re: JSP in Static Resources

2013-07-13 Thread Alireza Fattahi
Hi,

My situation is this:
The site which i work should work in RTL and LTR modes ( I am using YAML for 
layout)

The site.css should have this for LTR:

@import url(../yaml/navigation/hlist.css);
@import url(../yaml/forms/gray-theme.css);
@import url(../yaml/screen/typography.css);
@import url(../yaml/screen/screen-FULLPAGE-layout.css);

for RTL it must have

@import url(../../yaml/add-ons/rtl-support/core/base-rtl.css);
@import url(../../yaml/add-ons/rtl-support/navigation/hlist-rtl.css);
@import url(../../yaml/add-ons/rtl-support/forms/gray-theme-rtl.css);    


So I want to path a parameter to CSS and do some thing like this:

http://www.mysite.com/site.css?direction=rtl

and in the CSS
@import 
url(../../yaml/add-ons/rtl-support/core/base-%=request.getParameter(direction)%.css);


I donot want to to use if parameters in the jsp and do some thing like this:
if request.getParameter(direction)=RTL
{
link href=styles/site-rtl.css rel=stylesheet type=text/css /

}
else{
link href=styles/site-ltr.css rel=stylesheet type=text/css /

}


The problem is that, although you set the mime type of css to text/css in 
web.xml. it does not take effect.
I just find a bad work around which you must put %@page contentType=text/css 
%in top of all css files

 
~Regards,
~~Alireza Fattahi



 From: André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Saturday, 13 July 2013, 14:21
Subject: Re: JSP in Static Resources
 

Alireza Fattahi wrote:
 Hi,
 
 I want to add some jsp code in to my site.css.

Maybe it is just me, but that does not seem to make any sense.
Usually, it would be the other way around.
Can you explain why you want to do this ?

The idea of JSP is to have Java code which in the end produces a HTML page 
which is sent 
to the browser.  The JSP is compiled into a servlet, which is executed when the 
browser 
calls that JSP page. The servlet produces HTML, which is sent the browser.
The HTML page may contain links to CSS stylesheets, Javascript libraries etc.
The browser retrieves these directly, as static objects, when it finds a link 
in the HTML.
A CSS stylesheet is meant to provide instructions to the browser, about how to 
/render/ 
(display nicely) the final product, which is the HTML page (produced by the 
JSP/servlet).
I cannot really imagine a scenario in which having Java code in there would 
make any 
sense.  At the very least, that would make the later maintenance of that 
application 
hopelessly confusing.



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

Re: JSP in Static Resources

2013-07-13 Thread Alireza Fattahi
Guys please concentrate on the main issue !!

I ask again:

When you set jsp servlet to process the css files by adding:
servlet-mapping
    servlet-namejsp/servlet-name
    url-pattern*.css/url-pattern
/servlet-mapping


The tomcat does not set the CSS file extension mime type to text/css. Although 
below line is set in localhost-config/web.xml

    mime-mapping
    extensioncss/extension
    mime-typetext/css/mime-type
    /mime-mapping


When you manually set the content mime type %@page contentType=text/css % 
every thing will work fine


~Regards,
~~Alireza Fattahi

Tomcat Monitoring

2006-07-12 Thread Mr Alireza Fattahi
Hi,

We are using Tomcat 5.5, please let us know if there are any monitoring tools 
that we can use with this server.
We found Lambda Probe mentioned in the posts. 
Are there any built-in tools, or can we find some open sources for this issue?!




~Regards,
~~Alireza Fattahi

-
 All New Yahoo! Mail – Tired of [EMAIL PROTECTED]@! come-ons? Let our SpamGuard 
protect you.

Re: Getting the date/time from the client

2006-07-11 Thread Mr Alireza Fattahi
Hi,

May be you can use:
request.getDateHeader()

Have a look at, there is a related thread there:
http://www.theserverside.com/discussions/thread.tss?thread_id=38542



Vinu Varghese [EMAIL PROTECTED] wrote: Hi All,

 I am doing a project in jsp/servlet and tomcat, which requires to take 
the client date/time (ie the time of the machine the browser is 
running). Is there any way to accomplish this ?

Thanks  regards
Vinu

 

-- 


Vinu Varghese
[EMAIL PROTECTED]
www.x-minds.org




~Regards,
~~Alireza Fattahi

-
 Try the all-new Yahoo! Mail . The New Version is radically easier to use – 
The Wall Street Journal

Re: Tomcat shutdowns unexpectedly - Please help

2006-07-11 Thread Mr Alireza Fattahi
Hi,

I hope I get it correctly, the Tomcat shutdowns when it is ideal. That means no 
one is working with it and there is no connection to it.
If I assume correct and this is the case, please let me know if this shutdown 
happens when there are some connections to it.
We had this problem once with Apache and OracleAS, the OracleAS shouted down 
itself when it does not received any requests (made a suicide!) We end up 
writing a small program which was connected to Tomcat every 10 min and 
requested a dummy page. It solved it.

P.S: Did you configure your Tomcat with Apache?

Hope it helps you!



Martin Gainty [EMAIL PROTECTED] wrote: If the app is crashing then you would 
see exceptions thrown in wither catalina.out / stdout_MMDD.log / 
stderr_MMDD.log
If the service is crashing on startup(misconfigured JVM, startup jars missing) 
then check the jakarta_service_MMDD.log

HTH,
Martin--
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: David Smith 
To: Tomcat Users List 
Sent: Tuesday, July 11, 2006 7:51 AM
Subject: Re: Tomcat shutdowns unexpectedly - Please help


 I'm no expert, but off the top of my head it appears your JVM is 
 crashing.  Especially true if there is absolutely no logging data just 
 before the process stops.  You may have indications of what's happening 
 in other log files like syslog or a core dump file.  You may also want 
 to look at bug reports for your OS and JDK.
 
 
 --David
 
 Arunan Kannan wrote:
 
 Hi,

 Please help me in guiding to find out the root cause of this problem.

 Tomcat Version: jakarta-tomcat-4.1.31
 Server OS: SUN OS 5.8
 JDK version: j2sdk1.4.2_11

 Initially the tomcat server is running perfectly and there is no problem.
 There is no operation done on the server. Simply it is kept idle.
 After some 3 or 4 hours the tomcat gets shutdown unexpectedly.

 This happens repeatedly. Whenever I start the server, after some 3 or 4
 hours it gets stopped.
 There is not enough log to find the cause.

 I have posted this query in lot of forum and still it is a hard luck.
 I configured debug=5 in server.xml under conf directory to get maximum 
 log,
 then also no use.
 There is no application running in the tomcat server.

 Simply the when tomcat is started in this SUN server after a few ours it
 stops always.
 Please help me.
 Please let me know if I need to give more information.

 Thanks in advance,
 Thanks and Regards,
 Arunan

 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



~Regards,
~~Alireza Fattahi

-
 Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail.

ApacheConfig returns ClassCastException for mod_jk

2006-07-09 Thread Mr Alireza Fattahi
Hi,

We want to configure tomcat 5.5.17 with mod_jk and change server.xml as below:

Engine name=Catalina defaultHost=localhost  
className=org.apache.jk.config.ApacheConfig 

The above changed was mentioned at 
http://tomcat.apache.org/connectors-doc/howto/apache.html; to create a 
mod_jk.conf-auto file.

But, we get an error which sayes:
java.lang.ClassCastException: org.apache.jk.config.ApacheConfig
at 
org.apache.catalina.startup.LifecycleListenerRule.begin(LifecycleListenerRule.java:96)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1275)
at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:878)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)

Any comments!

Regards,
Alireza Fattahi


-
 All new Yahoo! Mail The new Interface is stunning in its simplicity and ease 
of use. - PC Magazine

ApacheConfig returns ClassCastException for mod_jk

2006-07-09 Thread Mr Alireza Fattahi
Hi,

We want to configure tomcat 5.5.17 with mod_jk and change server.xml as below:

Engine name=Catalina defaultHost=localhost  
className=org.apache.jk.config.ApacheConfig 

The above was mentioned at 
http://tomcat.apache.org/connectors-doc/howto/apache.html; to create a 
mod_jk.conf-auto file.

But, we get an error which sayes:
java.lang.ClassCastException: org.apache.jk.config.ApacheConfig
at 
org.apache.catalina.startup.LifecycleListenerRule.begin(LifecycleListenerRule.java:96)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1275)
at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:878)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)

Any comments!

Regards,
Alireza Fattahi


-
 All New Yahoo! Mail – Tired of [EMAIL PROTECTED]@! come-ons? Let our SpamGuard 
protect you.