I am wondering if there is a way to customize the structure/style of the directory listing generated by a Jetty server.
The app I'm working with runs on Tomcat, and has a xsl file that handles the listing there, but the testing environment runs on Jetty which renders a completely different page structure.
I'm hoping there is a way to customize the page served by Jetty so that it matches the one generated from the xsl file in Tomcat.
Note: this is only true for directory listings produced by the DefaultServlet on Jetty (all other directory listings you see from a Jetty server are not produced by Jetty itself, but rather by some 3rd party library)
The output of the directory listings provided by the Jetty Server can be customized with a CSS only.
Make a jetty-dir.css and Jetty in the root of your webapp and Jetty will use it.
Related
I have a web application getting deployed on embedded jetty 9.2.3
I have tried externalising the logging libraries and config from the web app by doing the following:
placed slf4j, logback-classic and logback-core libs under lib/logging
placed logback.xml file under resources
However, this does not have the desired effect and the logs are appearing in the same manner as it was with default jetty configuration.
If I place logback.xml and the dependencies within the web app, the logs are appearing correctly.
Any suggestions will be appreciated.
I'm running a web app with Jetty 9.0.5 (I could update, 9.1.2 is the latest as I write this). I have the usual web app deployer as described in the Jetty docs and defined in etc/jetty-deploy.xml. I use a Jetty xml file to define my web app context, so when I push new code to my production server, I upload a new myapp.war file using rsync and then touch that myapp.xml file. This works pretty well, but there are few seconds where the app throws a NullPointerException or other weirdness, and some users appear to be getting corrupt statically served files (.js files from the war), so that they have to flush their browser's cache for the app to work again.
Is this supposed to work perfectly, or do you expect a brief dead period like this?
I don't put the myapp.war in the webapps directory (only the the myapp.xml is there) and explodeWars is true in the deployer.
I am using wso2 application server v4.0 on Linux.
I have a webapp and I want to have a folder to store files. The folder size can be huge and the application could be redeployed as well, so directory is not inside the webapp.
How do I create a virtual directory or similar in wso2? That directory can be general, i mean it is not needed to be related to the webapp examples: localhost:80/myDirectory/ and localhost:80/myApplication/myDirectory/ are valid approaches to me.
There are some clear instructions to do it in tomcat but I can't find out how to translate this to tomcat in wso2.
Please checkout the sample available here.
I develop a Webservice using Netbeans 6.9 and I use an embedded glassfish server to deploy my Webservice (http://some_domain/project_name/ws_for_sl4). On a different server there is deployed a Silverlight 4 client, which should have accesss to the Webservice.
I know that I have to have clientaccesspolicy.xml (under http://some_domain/project_name) however I do not know how to do it. I mean, I do not know in which folder of the netbeans project I need to put clientaccesspolicy.xml to have it automaticly deployed on an embedded glassfish server. To have my SL4 client using the webservice.
Solution:
- put clientaccesspolity.xml and crossdomain.xml under /Web Pages*
- open Project Properties (click right mouse button on a project root), go to Run, and delete a value of "Context Path".
Now your WS will be deployed directly under some_domain as it is required by SL4 (SL4 is looking for these files under the domain name.). SL4 will have no problem to access clientaccesspolity.xml and crossdomain.xml.
In case anyone doesn't like moving their webservice to "root", and instead prefers to have it in http://localhost:8080/aDifferentLocation/MyActualWebService, then placing those XMLs in the project Web Pages folder doesn't cut it.
http://localhost:8080/aDifferentLocation/clientaccesspolicy.xml
and
http://localhost:8080/aDifferentLocation/crossdomain.xml
would not work, as they need to be in
http://localhost:8080/clientaccesspolicy.xml
and
http://localhost:8080/crossdomain.xml
To achieve this, you must track down the folder where your GlassFish server is installed, let's call it [GlassFishInstallPATH] and paste the XMLs into the subfolder called docroot:
[GlassFishInstallPATH]/domains/domain1/docroot/ <--here go the XMLs.
(source)
In case you're wondering how you would do the same thing in Eclipse, you must track down the ROOT folder in your Eclipse J2EE workspace:
C:\Eclipse_j2ee_workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ROOT/ <-- the XMLs go here.
I have a webapp (http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo/net/sf/maven/plugins/example-captaincasa-jnlp/0.1-SNAPSHOT/example-captaincasa-jnlp-0.1-SNAPSHOT.war/download) which uses jsf in a servlet container. This works fine with jetty-maven-plugin run-war target at my local pc. In the future I would like make more of this kind of webapps.
I am looking for a way to deliver these webapps with jetty via jnlp. The end user should be have a zero installation but the webapps needs servlet container and my hoster does not support a servlet container or application server or so on.
I don't like an embedded solution because in this case each webapp must be delivered with a separate jetty und run with a separate jetty -> too big size -> to many download size and so on.
The architecture should be similar to this:
(source: sourceforge.net)
Example: Bundle1 could contains jetty and deployed webapp1 and Bundle2 could contains jetty and deployed webapp1 and webapp2 (related to requirements of end user I would like deliver many variant of my webapps)
But what is my question?
Which jars of jetty are needed? I would like these upload to my homepage for hosting.
Which jar should I use for jetty as main jar to start him via jnlp?
Which main class should I use to start jetty via jnlp?
Which parameter could I use to configure jetty to say this is war of webapp1 and this is war of webapp2.... or this is directory of weapps for hot deployment...?
The important question for me is 1. If this is answered so that I could run jetty local (without maven plugin) and via manual maybe I could solve the rest 2-4.
Why not deploy a normal Java app (with a main() etc.) that invokes Jetty programatically via its Server class? That class is configured via code with the appropriate contexts, servlet classes etc.
I've done that before with success. The only headache is running one Jetty with multiple apps being downloaded on request (if I read your question correctly). Can you use some classloading magic, and load classes/apps on demand from a remote URL ?
I have found another way today. This is interesting too. Here is the concept:
Use java webstart to install an osgi container
Use a bundle x or a osgi service to download all bundles of your app
Use the jetty bundle to provide jetty support
Then the application is installed
I got the idea from this article:
http://www.toedter.com/blog/?p=45