Ok, it works now - thank you! I removed the filters and noticed in web.xml

    <servlet-mapping>
        <servlet-name>CountRequestsServlet</servlet-name>
        <url-pattern>/CountRequestsServlet</url-pattern>
    </servlet-mapping>


    <servlet-mapping>
        <servlet-name>CountRequestsServlet</servlet-name>
        <url-pattern>/TestWriteAfterServlet</url-pattern>
    </servlet-mapping>

I accessed it like:

http://127.0.0.1:8080/TestWriteAfterServlet

This servlet has been accessed via GET 1005 times.

Question:
Will there be a security hazard if someone connects to the Winstone server running embedded in my application on the desktop?

thanks,
Anil


Rick Knowles <rick@knowleses.org> wrote:
There is actually a web.xml supplied in the
src/testwebapp/WEB-INF/web.xml file in the source distribution if you
want to get it running quickly.

Rick

Rick Knowles wrote:
> I think you need to re-read the servlet spec in a bit more detail,
> especially the section entitled "Request Dispatching".
>
> You'll need a web.xml with an explicit mapping for that class, or with
> the option to enable the invoker servlet
>
> serverArgs.put("useInvoker", "true");
> serverArgs.put("invokerPrefix", "/servlet/");
>
> That method of servlet invocation was deprecated nearly 10 years ago by
> v2.2 of the servlet spec.
>
> Rick
>
> Anil Philip wrote:
>
>> I am running winstone embedded, from Eclipse on XP. It starts up
>> successfully.
>>
>> Map serverArgs = new HashMap();
>> serverArgs.put("httpPort", "8080");
>> serverArgs.put("webroot", "C:/Projects/winstone");
>> serverArgs.put("ajp13Port", "-1");
>> serverArgs.put("controlPort", "-1");
>> serverArgs.put("httpListenAddress", "127.0.0.1");
>>
>> try {
>> Launcher.initLogger(serverArgs);
>> Launcher winstone = new Launcher(serverArgs);
>>
>>
>> } catch (IOException e) {
>> e.printStackTrace();
>> }
>>
>>
>> I build the sample servlet CountRequestsServlet from winstone src
>> folder and then copy it to web root.
>>
>> C:\Projects\winstone\WEB-INF\classes\winstone\testApplication\servlets
>>
>> In the browser, I use this URL
>>
>> http://127.0.0.1:8080/servlet/winstone.testApplication.servlets.CountRequestsServlet
>>
>>
>> I get
>>
>> Status Code: 404
>> Exception: File
>> /servlet/winstone.testApplication.servlets.CountRequestsServlet not found
>> Stacktrace:
>>
>> (none)
>>
>>
>> Generated by Winstone Servlet Engine v0.9.10 at Wed May 21 22:51:38
>> CDT 2008
>>
>> Any help appreciated.
>> thanks,
>> Anil
>>
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Winstone-devel mailing list
>> Winstone-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/winstone-devel
>>
>>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Winstone-devel mailing list
> Winstone-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/winstone-devel
>