Re: /META-INF/resources/ and Chrome's DevTools

2020-03-15 Thread Konstantin Kolinko
вс, 15 мар. 2020 г. в 13:47, Peter Rader :
>
> I have my default.js in a frontend.jar's /META-INF/resources/js/ according to 
> the specs (last paragraph of point 10.10 in 
> https://download.oracle.com/otn-pub/jcp/servlet-3.0-fr-eval-oth-JSpec/servlet-3_0-final-spec.pdf
>  ) it is served successfully. This works great!

1. If you unpack the file into a directory in your web application
(into its /js/ directory),
it will take precedence over the version packed in the framework jar.


2. It is possible to map files from elsewhere on your hard drive into
your web application.
It can be done with "" element in the
META-INF/context.xml file of your web application.

For reference:
http://tomcat.apache.org/tomcat-9.0-doc/config/resources.html


3. If your Tomcat runs on the same computer. you can run the web
application from an expanded directory, without packing it as a war
file.

1) Copy your META-INF/context.xml file as
$CATALINA_BASE/conf/Catalina/localhost/yourwebappname.xml

2) Add docBase attribute to the  element in it.

See
http://tomcat.apache.org/tomcat-9.0-doc/config/context.html#Defining_a_context


Best regards,
Konstantin Kolinko

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



Aw: /META-INF/resources/ and Chrome's DevTools

2020-03-15 Thread Peter Rader
I wrote a little WebFilter for this task.

https://github.com/enexusde/devtools-tomcat-bypass

Kind regards

Peter Rader
--
Fachinformatiker AE / IT Software Developer
Peter Rader
Wilsnacker Strasse 17
10559 Berlin - GERMANY
Tel: 0049 (0)30 / 20 9930560
Fax: 0049 (0)30 / 20 9930561
Handy: 0049 (0)176 / 8 7521576

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



/META-INF/resources/ and Chrome's DevTools

2020-03-15 Thread Peter Rader


I have my default.js in a frontend.jar's /META-INF/resources/js/ according to 
the specs (last paragraph of point 10.10 in 
https://download.oracle.com/otn-pub/jcp/servlet-3.0-fr-eval-oth-JSpec/servlet-3_0-final-spec.pdf
 ) it is served successfully. This works great!

Chrome load this default.js during surfing on localhost. Using DevTools I can 
map this in-browser-default.js to a local directory. This allowes chrome to 
synchronize the local source-version of the default.js with the in-browser 
loaded default.js.

This way I have a source-cascade.
1. The default.js is Packed into the frontend.jar.
2. The frontend.jar is Packed into the application.war.
3. The application.war is served via Tomcat.

The Problem:

If I reload the website Chrome DevTools drops all changes I made to the Tomcat 
served version. 
So if I change a single byte in the default.js I have to:
1. Pack the jar
2. Pack the war
3. Redeploy the war.

This process takes a length of about 5 minutes. It is reloading the application 
and package the jars/wars for the sake of 1 byte change.

The Question:

Can I map a single resource to a file dynamically without reloading the 
application.


Kind regards

Peter Rader
--
Fachinformatiker AE / IT Software Developer
Peter Rader
Wilsnacker Strasse 17
10559 Berlin - GERMANY
Tel: 0049 (0)30 / 20 9930560
Fax: 0049 (0)30 / 20 9930561
Handy: 0049 (0)176 / 8 7521576

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