for CSS effects , every-time i need to restart the app .

34 views
Skip to first unread message

Ashish

unread,
Oct 5, 2012, 4:13:44 AM10/5/12
to scooter-...@googlegroups.com
hi friends ,
I've a simple doubt , I'm adding css to my app but to see the effects every-time i need to restart the app ..
I know this is weird but wanted to know  Is there anything i forget to configure or It's bug ?
Is there anyone who had same problem ?

ashok

unread,
Oct 7, 2012, 4:29:07 AM10/7/12
to scooter-...@googlegroups.com
ya i have same problem when i add css to my app then to see the effects every-time i need to restart the app ..

Yohanes Gultom

unread,
Oct 7, 2012, 5:13:38 AM10/7/12
to scooter-...@googlegroups.com
Did you guys using scooter's jetty? I don't remember having such problem in my last scooter project as scooter's jetty automatically load css from webapps

Ashish

unread,
Oct 7, 2012, 5:57:21 AM10/7/12
to scooter-...@googlegroups.com
Yohanes,
Thanks for the answer . can you tell me the steps , how can i use jetty ?

I didn't configured anything for jetty, I'm using simple run server command > java -jar tools/server.jar <appname>

Ashish

unread,
Oct 7, 2012, 6:01:27 AM10/7/12
to scooter-...@googlegroups.com
hey yohanes,
checkout the log and acording to that i think Jetty is already running for the port:8080 ...  I don't know why the css is not loading ....
:(

scooTer> =========================================
scooTer> 
scooTer> Starting Jetty Web Server on default port 8080
scooTer> 
scooTer> scooter.home: /media/Development/ToolKit/frameworks/scooter
scooTer>     app.name: codeleaf
scooTer>     app.logs: /media/Development/ToolKit/frameworks/scooter/webapps/codeleaf/WEB-INF/log
scooTer>     app.path: /media/Development/ToolKit/frameworks/scooter/webapps/codeleaf
scooTer>     app.port: 8080
scooTer>   jetty.home: /media/Development/ToolKit/frameworks/scooter/tools/servers/jetty
scooTer>   jetty.logs: /media/Development/ToolKit/frameworks/scooter/tools/servers/jetty/logs
scooTer>   jetty.init: /media/Development/ToolKit/frameworks/scooter/tools/servers/jetty/start.config
scooTer>   jetty.xmls: /media/Development/ToolKit/frameworks/scooter/tools/servers/jetty/etc/jetty.xml
scooTer> 
scooTer> Use Ctrl-C to shutdown server
scooTer> 
scooTer> =========================================

John Chen

unread,
Oct 7, 2012, 10:27:16 AM10/7/12
to scooter-...@googlegroups.com
Ashish,

I can't repeat what you found in Scooter 1.3.

Here is what I did. I tested with the HelloWorld example:
1. Copy scooter\examples\greeting directory to scooter\webapps\.
2. From Terminal (DOS) window, type scooter>java -jar tools/server.jar greeting
3. From browser, enter URL: http://localhost:8080/greeting/welcome/sayit and see JSP page loaded.
4. Open file scooter\webapps\greeting\static\stylesheets\main.css
5. Change first line from
body { background-color: white; }
to
body { background-color: red; }
6. Refresh browser. Now the background of screen is changed to red color without restarting server.

Hope this helps.

Ashish

unread,
Oct 8, 2012, 4:49:21 AM10/8/12
to scooter-...@googlegroups.com
yeah,that sample app is works like a charm ..

For a test,I've created testapp and follows your instruction, but the problem is same ...
can you please do a test ? please find the attachment .
testapp.zip

John Chen

unread,
Oct 9, 2012, 11:55:33 PM10/9/12
to scooter-...@googlegroups.com
This is because by default, newly created apps use cache. 

So in your web.xml file, you can take out the whole "WebPageCachingFilter" section or indicate that you do not want to cache css style sheet:
  <filter>
    <filter-name>WebPageCachingFilter</filter-name>
    <filter-class>com.scooterframework.web.controller.WebPageCachingFilter</filter-class>
    <init-param>
      <param-name>cacheName</param-name>
      <param-value>WebPageCachingFilter</param-value>
    </init-param>
    <init-param>
      <param-name>uncacheablePaths</param-name>
      <param-value>/about, /static/stylesheets/main.css</param-value>
    </init-param>
  </filter>

The above code tells Scooter that accessing to /about web page (about.jsp) and accessing to main.css should not be cached. 
Please notice that the correct param name is "uncacheablePaths".

John

Ashish

unread,
Oct 11, 2012, 5:03:30 PM10/11/12
to scooter-...@googlegroups.com
Thanks john ... 
It works , everytime i'm learning new new things .. 
Reply all
Reply to author
Forward
0 new messages