By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,469 Members | 1,885 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,469 IT Pros & Developers. It's quick & easy.

please help

Shanaj
P: 51
please go through this site

http://www.myjavaserver.com/signup

Signup


MyJavaServer provides a development environment for Java web applications.

An open environment like MJS is a target of malicious users who abuse our services for illegal or simply inappropriate activities.
In order to minimize abuse and yet provide our services to all interested Java developers for free, we require you to demonstrate your Java skills. The challenge is easy to master but does require some knowledge of the Java programming language.

Signup Challenge
Master a simple Java programming challenge (STATUS: NOT PASSED)

As the principal engineer of an HTTP web server, you are responsible for implementing the request processing subsystem of the server.
An incoming request for a specific resource, identified by an URI, must be dispatched to the appropriate handler according to the server configuration which maps URIs to request handlers. 'HandlerFactory.getHandler' must be implemented:

public class HandlerFactory
{
public String getHandler(String[] config, String requestUri)
{
}
}


The string array 'config' contains URI patterns and handler names. Two consecutive values form a key-value pair comprised of URI pattern and handler. 'requestUri' represents an incoming request, the URI to match against the configured handlers. 'getHandler' must return the correct handler for a given URI as a string value.

An URI pattern never contains wildcards and represents the start of an URI string, a prefix. Matching must be implemented accordingly. The handler with the longest matching URI pattern wins if more than one pattern matches. If no handler can be found, "r5eGOA" must be returned.

Example input:

String[] config: { "/", "MainServlet", "/nav", "NavigationServlet" }
String requestUri: "/nav/test"

Correct result: "NavigationServlet"

In this example, the configuration contains a mapping of "/" to "MainServlet" and "/nav" to "NavigationServlet". In the case of an incoming URI "/nav/test.nav", "NavigationServlet" is the correct choice because its pattern is longer than that of "MainServlet".
Jan 22 '07 #1
Share this Question
Share on Google+
2 Replies


10K+
P: 13,264
please go through this site

http://www.myjavaserver.com/signup

Signup


MyJavaServer provides a development environment for Java web applications.

An open environment like MJS is a target of malicious users who abuse our services for illegal or simply inappropriate activities.
In order to minimize abuse and yet provide our services to all interested Java developers for free, we require you to demonstrate your Java skills. The challenge is easy to master but does require some knowledge of the Java programming language.

Signup Challenge
Master a simple Java programming challenge (STATUS: NOT PASSED)

As the principal engineer of an HTTP web server, you are responsible for implementing the request processing subsystem of the server.
An incoming request for a specific resource, identified by an URI, must be dispatched to the appropriate handler according to the server configuration which maps URIs to request handlers. 'HandlerFactory.getHandler' must be implemented:

public class HandlerFactory
{
public String getHandler(String[] config, String requestUri)
{
}
}


The string array 'config' contains URI patterns and handler names. Two consecutive values form a key-value pair comprised of URI pattern and handler. 'requestUri' represents an incoming request, the URI to match against the configured handlers. 'getHandler' must return the correct handler for a given URI as a string value.

An URI pattern never contains wildcards and represents the start of an URI string, a prefix. Matching must be implemented accordingly. The handler with the longest matching URI pattern wins if more than one pattern matches. If no handler can be found, "r5eGOA" must be returned.

Example input:

String[] config: { "/", "MainServlet", "/nav", "NavigationServlet" }
String requestUri: "/nav/test"

Correct result: "NavigationServlet"

In this example, the configuration contains a mapping of "/" to "MainServlet" and "/nav" to "NavigationServlet". In the case of an incoming URI "/nav/test.nav", "NavigationServlet" is the correct choice because its pattern is longer than that of "MainServlet".
What is the point in all this? Do you want help to do this?
Jan 22 '07 #2

Shanaj
P: 51
What is the point in all this? Do you want help to do this?
YES,i didn't get the question
Jan 24 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.