Manlio Malaidini | 1 Dec 2005 11:24
Picon

what is tagPlugins.xml for? (was Re: [newbie] making jstl to work when jetty is run programatically)

I have received no answers, but I tried to dig it a little bit more on my own. Not very successful, to be honest.
 
Anyway, after activating all possible logs I have seen that jetty was looking for tagPlugins.xml, without finding it. I have added the file, taken from jsp-examples.war
 
Now I get a NullPointerException executing the jsp:

EXCEPTION
org.apache.jasper.JasperException
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
 at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
 at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:666)
 at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
 at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
 at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
 at org.mortbay.http.HttpServer.service(HttpServer.java:954)
 at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
 at org.mortbay.http.HttpConnection.handleNext (HttpConnection.java:983)
 at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
 at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
 at org.mortbay.util.ThreadedServer.handle (ThreadedServer.java:357)
 at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
/servletspike/jsp/jstl.jsp:
java.lang.NullPointerException
 at org.apache.jsp.jsp.jstl_jsp._jspService(jstl_jsp.java:228)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java :324)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java :689)
 at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
 at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:666)
 at org.mortbay.jetty.servlet.ServletHandler.handle( ServletHandler.java:568)
 at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
 at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
 at org.mortbay.http.HttpServer.service(HttpServer.java:954)
 at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
 at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
 at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
 at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
 at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
 at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
/servletspike/jsp/jstl.jsp:
java.lang.NullPointerException
 at org.apache.jsp.jsp.jstl_jsp._jspService(jstl_jsp.java:228)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
 at javax.servlet.http.HttpServlet.service( HttpServlet.java:689)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
 at org.apache.jasper.servlet.JspServlet.service (JspServlet.java:236)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
 at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
 at org.mortbay.jetty.servlet.ServletHandler.dispatch (ServletHandler.java:666)
 at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
 at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
 at org.mortbay.http.HttpContext.handle(HttpContext.java :1517)
 at org.mortbay.http.HttpServer.service(HttpServer.java:954)
 at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
 at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
 at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
 at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
 at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
 at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

The jsp is as simple as the following:

<% <at> page import="java.util.*" %>

<% <at> taglib uri="http://java.sun.com/jsp/jstl/core"
       prefix="c" %>
      
<%! private List list = new ArrayList(); %>
<% list.add(1); list.add(2); list.add(3); %>

<HTML>
<HEAD><TITLE>JSTL</TITLE></HEAD>
<BODY>
    <c:forEach var="item" begin="1" end="10">
        <c:out value="${item}"/>
    </c:forEach>
   
 <UL>
 <c:out value="${1 + 2 + 3}"/>
 <c:out value="${list.size()}"/>
 <c:forEach var="elem" items="${list}">
     <LI> <c:out value="${elem}"/> </LI>
 </c:forEach>
 </UL>
</BODY>
</HTML>

The jsp is compiled.
 
I am confused. Can anybody help me, please?!?
TIA

 
On 11/28/05, Manlio Malaidini <mmalaidini <at> gmail.com > wrote:
Hi!

I'm still experimenting and I cannot understand how to make jstl to work.

I'm using Jetty 5.1.5rc2. I'm running jetty through the following main:

    public static void main(String[] args) throws Exception
    {
        HttpServer server = new HttpServer();
        server.addListener(":8080");
       
        HttpContext context = new HttpContext();
        context.setContextPath("/");
        ServletHandler servletHandler = new ServletHandler();
        servletHandler.addServlet("jsp", "*.jsp", " org.apache.jasper.servlet.JspServlet");
        servletHandler.addServlet("Invoker", "servlet/*", "org.mortbay.jetty.servlet.Invoker");
        context.addHandler(servletHandler);
        ResourceHandler resourceHandler = new ResourceHandler();
        resourceHandler.setDirAllowed(true);
        context.addHandler(resourceHandler);
        context.setResourceBase("./");
        server.addContext(context);
       
        server.start();
    }

I have jstl.jar and standard.jar in my WEB-INF.lib but if I invoke a jsp like the following:

<% <at> page import="java.util.*" %>

<% <at> taglib uri=" http://java.sun.com/jsp/jstl/core"
       prefix="c" %>
      
<%! private List list = new ArrayList(); %>
<% list.add(1); list.add(2); list.add(3); %>

<HTML>
<HEAD><TITLE>JSTL</TITLE></HEAD>
<BODY>
    <c:forEach var="item" begin="1" end="10">
        <c:out value="${item}"/>
    </c:forEach>
   
    <UL>
    <c:out value="${list.size()}"/>
    <c:forEach var="elem" items="${list}">
        <LI> <c:out value="${elem}"/> </LI>
    </c:forEach>
    </UL>
</BODY>
</HTML>
 

I get:
${item} ${item} ${item} ${item} ${item} ${item} ${item} ${item} ${item} ${item}
    ${list.size()}
  • ${elem}

It seems that it cannot evaluate variables in context, giving me their literals and not their actual values.

What am I doing wrong? It got to be stupid, I guess, but I wasn't able to solve it after browsing the archives, searching mortbay.org, etc.

Thanks a lot
MM

Oscar Pernas Plaza | 1 Dec 2005 15:09
Picon
Gravatar

jetty and axis


Hello, I am newbie in this. I implemented a web service with tomcat and axis 
for my  end degree project. I have to replace tomcat with jetty. Anyone 
knowns a tutorial  or examples for invoke axis with jetty?

Thanks

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Xiao-fei.Song | 2 Dec 2005 08:49
Picon
Favicon

Re: Chinese characters in the URL


Hi,

Anybody gives me a reponse on that? I mean can we make any changes on jetty to support multibyte characters on the URL like Chinese and Japanese? Any suggestions will be appreciated.

Regards,
Xiaofei



Xiao-fei.Song <at> sybase.com
Sent by: jetty-support-admin <at> lists.sourceforge.net

11/15/2005 05:40 PM

Please respond to
jetty-support <at> lists.sourceforge.net

To
jetty-support <at> lists.sourceforge.net
cc
Subject
[Jetty-support] Chinese characters in the URL






Hi all,

I need to handle the chinese characters directly in the URL. As I debug Jetty, I found even I call request.setCharacterEncoding("GBK") or turn org.mortbay.util.URI.charset to GBK, while in jetty, this won't work because the code seems to indicate only when the url is encoded to %HH the character encoding setting takes effect. IE and Mozilla&Firefox behave different in this case in that firefox encodes the Chinese character in the url to %HH before sending them out while IE does not do that, so firefox works well with Jetty.
On the other hand, tomcat 5.5 works with both IE and firefox after setting URIEncoding="GBK" in server.xml.
Any help will be much appreciated.

Regards,
Xiaofei
Greg Wilkins | 2 Dec 2005 23:03
Gravatar

Re: Initializing servlets with references to existing objects


Benjamin,

the problem is that the context attributes are a merge of the ones set each
start cycle from web.xml and by the app itself   PLUS any configured attributes
set before the webapp is started.

You are using  getServletContext().setAttribute  before the webapp is started
and hence you get the NPE (OK crappy error!)

You can just set your attributes directly on the webApplicationContext
and they will be available as context attributes to your webapp.

Benjamin Podszun wrote:
> Hi there.
> 
> In my project I have a default/delegator servlet that needs access to  a
> (reference to an) object. I currently start the server like this:
> 
> WebApplicationContext webAppContext;
> _jetty = new Server();
> 
> // logging config here..
> 
> webAppContext = new WebApplicationContext();
> webAppContext = _jetty.addWebApplication("/", config.getServerRoot
> ().getAbsolutePath());
> WebApplicationHandler handler = new WebApplicationHandler();
> ServletHolder delegator = handler.addServlet("/*", 
> DelegatorServlet.class.getName());
> 
> // Does't work
> // delegator.getServletContext().setAttribute("MyObject", someObject);
> 
> FilterHolder filterHolder = handler.defineFilter("DBFilter", 
> DBFilter.class.getName());
> handler.addFilterHolder(filterHolder);
> webAppContext.addHandler(handler);
> _jetty.start();
> 
> I added the commented part of my last try: I thought I maybe could  add
> my reference to the ServletContext, but that ends up with a NPE 
> although the object is not null when I setAttribute() it..
> 
> Any hints how to do that? I don't want the servlet to access the rest 
> of the application via static methods.
> 
> Thanks in advance,
> Ben
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Jetty-support mailing list
> Jetty-support <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jetty-support
> 

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Greg Wilkins | 2 Dec 2005 23:05
Gravatar

Re: with DEBUG/TRACE on, (ignorable) socket timeout exceptions in 5.1.5?


Eric,

I hate!

  try
  {
     ...
  }
  catch(Exception e)
  {}

So jetty always does at least a 

  try
  {
     ...
  }
  catch(Exception e)
  {
     LogSupport.ignore(e);
  }

So you can see ALL exceptions if you need to.

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Greg Wilkins | 2 Dec 2005 23:08
Gravatar

Re: Error 404 after moving from 4.2.23 to 5.1.6 using xml configuration


Bill,

nothing shouts out in that xml as wrong.

Can you drop your webapp into $JETTY_HOME/webapps and try the standard jetty.xml
with the release.   This will confirm that your webapp is OK with Jetty 5.

we can then look in more detail at what the problem is (or just cut back the
new jetty.xml to what you need).

cheers

Bill Ferrett wrote:
> I am using the following xml configuration file under 4.2.23 and I can
> access my servlet using
> http://myserver:8080/mycontext/servlet/myservlet
> 
> however after installing 5.1.6 this no longer works.  I can access html
> files, e.g.
> http://myserver:8080/mycontext/index.html
> but any servlet requests result in an error 404.
> My servlet is loaded on startup perfectly - I can tell from the log - I
> just can't access it.  I assume I need to modify my xml file for 5.x.y
> but I can't find any info on what needs to be changed
> 
> <!-- =============================================================== -->
> <!-- Configure the Jetty Server                                      -->
> <!-- =============================================================== -->
> <Configure class="org.mortbay.jetty.Server">
> 
>   <!-- =============================================================== -->
>   <!-- Configure the Request Listeners                                 -->
>   <!-- =============================================================== -->
> 
>   <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
>   <!-- Add and configure a HTTP listener to port 8080      -->
>   <!-- The default port can be changed using: java -Djetty.port=80     -->
>   <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
>   <Call name="addListener">
>     <Arg>
>       <New class="org.mortbay.http.SocketListener">
>         <Set name="Port"><SystemProperty name="jetty.port"
> default="8080"/></Set>
>         <Set name="MinThreads">5</Set>
>         <Set name="MaxThreads">50</Set>
>         <Set name="MaxIdleTimeMs">30000</Set>
>         <Set name="LowResourcePersistTimeMs">1000</Set>
>         <Set name="ConfidentialPort">8443</Set>
>         <Set name="IntegralPort">8443</Set>
>         <Set name="PoolName">http</Set>
>         <Set name="LingerTimeSecs">-1</Set>
>       </New>
>     </Arg>
>   </Call>
> 
> 
>   <!-- =============================================================== -->
>   <!-- Configure the Contexts                                          -->
>   <!-- =============================================================== -->
>   <Call name="addWebApplication">
>     <Arg>/mycontext/*</Arg>
>     <Arg>c:\apps\mycontext</Arg>
>     <Set name="extractWAR">false</Set>
>   </Call>
> 
>   <!-- =============================================================== -->
>   <!-- Configure the Request Log                                       -->
>   <!-- =============================================================== -->
>   <Set name="RequestLog">
>     <New class="org.mortbay.http.NCSARequestLog">
>       <Arg><SystemProperty name="jetty.home"
> default="."/>/logs/yyyy_mm_dd.request.log</Arg>
>       <Set name="retainDays">90</Set>
>       <Set name="append">true</Set>
>       <Set name="extended">false</Set>
>       <Set name="buffered">false</Set>
>       <Set name="LogTimeZone">GMT</Set>
>     </New>
>   </Set>
> 
>   <!-- =============================================================== -->
>   <!-- Configure the Other Server Options                              -->
>   <!-- =============================================================== -->
>   <Set name="requestsPerGC">2000</Set>
>   <Set name="statsOn">false</Set>
> 
> </Configure>
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Jetty-support mailing list
> Jetty-support <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jetty-support
> 

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Alex Karasulu | 3 Dec 2005 07:15

Static vs. Dynamic content stream differences.

I have a servlet which reads static content sitting on disk and pumps it 
out in the response stream.  This servlet reads a jar file (a J2ME 
application) from disk and returns it's bytes as a 
application/java-archive.  The same jar file can be accessed directly 
rather than going through the servlet.  Here are the two URLs to access 
this jar file:

(1) http://karasulu.homeip.net/activation/test/
(2) http://karasulu.homeip.net/activation/HausKeys.jar

I made sure the response headers and content type of the servlet (1) 
matches that of the server's response to the direct static file access 
in (2).  Now here's the interesting problem:

The two resultant streams are different somehow and I cannot figure out 
how.  I know they are different because my Sony Ericsson T610 can load 
(2) just fine.  However when it tries to load from (1) the request makes 
it to the servlet and initiates the return of the response but the 
response causes the phone to give me the following error:

"Your client is not allowed to access the requested object"

I would like both these URLs to have the same effect hence be exactly 
the same through the eyes of this phone's WAP browser.  Something in the 
responses is different.  Even though the response headers are all the 
same I cannot get these two URLs to behave the same way.  Here are the 
headers for both (obviously with different dates):

statusCode: 200
statusLine: HTTP/1.1 200 OK
statusText: OK
responseCharSet: ISO-8859-1
responseFooters:
responseHeaders:
    Date: Fri, 02 Dec 2005 19:13:24 GMT
    Server: Jetty/5.1.5 (Linux/2.6.14-1.1637_FC4 i386 java/1.5.0_05
    Content-Type: application/java-archive
    Content-Length: 33603
    Accept-Ranges: bytes
    Last-Modified: Fri, 02 Dec 2005 19:13:24 GMT

Ahh and from the Server header you can see that I'm using Jetty 5.1.5 on 
SUN JDK 1.5.0_05.  Any clue as to what is different in these responses?  
I'm totally perplexed.

Thanks much,
Alex

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Clemens Eisserer | 3 Dec 2005 14:18
Picon

Is a webapplication guaranteed to have the same ClassLoader for different Servlets?

Hi there,

I am currently implementing a servlet-interface and I want to hold
some server-wide valid data in SingleTons.
However several different servlets in the same webblication (outch,
buzzword) and all those servlets want to share data via the
singletons.

This works but I have fears that its maybe a bit dirty and not
guaranteed to work.
So is a weblication (one directory containing a Web-INF and the
several servlet-classes) guaranteed to be loaded by the same
classloader (and therefor share the same static fields?).

Thanks you in advance, lg Clemens

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Thomas Dudziak | 4 Dec 2005 01:38
Picon
Gravatar

Tracing requests in normal operation ?

Hi,

I want to trace requests - including the content - during normal
operation. E.g. there is a web application running which receives
requests which I want to intercept and log/dump/whatever without the
web application taking notice.
How would I achieve that ? Right now if I define my own HttpHandler
and therein access the content, it gets consumed. But there does not
seem to be an easy way to manipulate the input stream in the request ?

regards,
Tom

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Benjamin Podszun | 5 Dec 2005 02:29
Picon

Re: Re: Initializing servlets with references to existing objects

Hi Greg.
First of all: Thanks for your answer.

On 02.12.2005, at 23:03, Greg Wilkins wrote:
> the problem is that the context attributes are a merge of the ones  
> set each
> start cycle from web.xml and by the app itself   PLUS any  
> configured attributes
> set before the webapp is started.

Sounds exactly like I want it to be.

> You are using  getServletContext().setAttribute  before the webapp  
> is started
> and hence you get the NPE (OK crappy error!)

Makes sense - I understand that the ServletContext doesn't exist  
before I actually start the server.

> You can just set your attributes directly on the webApplicationContext
> and they will be available as context attributes to your webapp.

I'm not sure if I understood this one. I tried

WebApplicationHandler handler = new WebApplicationHandler();
handler.addServlet("/*", DelegatorServlet.class.getName());
handler.setContextAttribute("foo", "bar");

which unfortunately results in exactly the same problem/error. Unless  
I comment this entry I get

Dec 5, 2005 2:17:48 AM myclass start
SEVERE: null
java.lang.NullPointerException
         at  
org.mortbay.jetty.servlet.ServletHandler.getContextAttribute 
(ServletHandler.java:934)
         at  
org.mortbay.jetty.servlet.WebApplicationHandler.setContextAttribute 
(WebApplicationHandler.java:585)
         at myclass.start(Unknown Source)
         at myclass.main(Unknown Source)

I tried as well

WebApplicationHandler handler = new WebApplicationHandler();
ServletHolder delegator = handler.addServlet("/*",  
DelegatorServlet.class.getName());
delegator.setInitParameter("foo", "bar");

which works fine - but only for String(s) and not for Objects/ 
references..

Did I missunderstand what you suggested? Or am I doing something  
stupid anyway? I just want to put some properties (Objects)  
programmatically into the servlet context before it is initialized..

Thanks in advance,
Ben

>
> Benjamin Podszun wrote:
>> Hi there.
>>
>> In my project I have a default/delegator servlet that needs access  
>> to  a
>> (reference to an) object. I currently start the server like this:
>>
>> WebApplicationContext webAppContext;
>> _jetty = new Server();
>>
>> // logging config here..
>>
>> webAppContext = new WebApplicationContext();
>> webAppContext = _jetty.addWebApplication("/", config.getServerRoot
>> ().getAbsolutePath());
>> WebApplicationHandler handler = new WebApplicationHandler();
>> ServletHolder delegator = handler.addServlet("/*",
>> DelegatorServlet.class.getName());
>>
>> // Does't work
>> // delegator.getServletContext().setAttribute("MyObject",  
>> someObject);
>>
>> FilterHolder filterHolder = handler.defineFilter("DBFilter",
>> DBFilter.class.getName());
>> handler.addFilterHolder(filterHolder);
>> webAppContext.addHandler(handler);
>> _jetty.start();
>>
>> I added the commented part of my last try: I thought I maybe  
>> could  add
>> my reference to the ServletContext, but that ends up with a NPE
>> although the object is not null when I setAttribute() it..
>>
>> Any hints how to do that? I don't want the servlet to access the rest
>> of the application via static methods.
>>
>> Thanks in advance,
>> Ben

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support


Gmane