Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> I Need Help With Java
marcio
post Jul 19 2007, 11:42 AM
Post #1


Newbie [Level 1]
*

Group: Members
Posts: 12
Joined: 16-July 07
Member No.: 46,575



I dont have much knowlege with java yet. Im a php programer not a java programer but i want to learn java and i need this coding to correct so that i can carry on my learning of java. So please some one just take some time to help me.

Heres what i need to do.

QUOTE
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:
CODE
public class HandlerFactory
{
  public String getHandler(String[] config, String requestUri)
  {
  }
}

QUOTE

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, "BrK2jgi" must be returned.

CODE
Example input:

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

  Correct result: "NavigationServlet"

QUOTE
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".


Ok now this is what i start with and have to do as they say above.

CODE
public class HandlerFactory
{
  public String getHandler(String[] config, String requestUri)
  {
  }
}
Go to the top of the page
 
+Quote Post
marcio
post Jul 20 2007, 08:04 AM
Post #2


Newbie [Level 1]
*

Group: Members
Posts: 12
Joined: 16-July 07
Member No.: 46,575



still no one that can help me? I know thisnt a hard task if u know java so some just point me out.thank you.
Go to the top of the page
 
+Quote Post
ramandhingra
post Aug 2 2007, 11:14 AM
Post #3


Newbie [Level 1]
*

Group: Members
Posts: 13
Joined: 2-August 07
Member No.: 47,434



I didnt get what you are actually asking for. And maybe.. thats the case with others and thats y u havent got a reply till yet.. Juz write the thing you want to achieve.. Plenty will write back the code and will be more than happy to explain it.
Go to the top of the page
 
+Quote Post
apicolet
post Nov 22 2007, 12:05 PM
Post #4


Newbie
*

Group: Members
Posts: 8
Joined: 22-November 07
From: Antibes, France
Member No.: 53,494



I just found out this is actually a challenge from myjavaserver.com ! They typically ask for the solution not to be disclosed...

This post has been edited by apicolet: Nov 23 2007, 04:51 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Helpful Registry Edit For Java Programmers(3)
  2. Java Script To Hide The Url In Address Bar(6)
  3. Fun In Sun (java)(2)
  4. Jsp Or Java Chat Script Like Mig33(5)
  5. Java Or C++(10)
  6. Best Java Framework For J2ee?(6)
  7. Which Is Good Java Or Dot Net(3)
  8. Budding Java Game Developers?(10)
  9. [help] Java Script: Window.open(10)
  10. Learn Java Programming Language Online Step By Step(1)
  11. How To Create Java Button Or Frame(14)
  12. Java Mobile Applications(7)
  13. Java De/compiler(5)
  14. Java Obfuscator(1)
  15. Java For The Beginning Programmer Ebook(4)
  1. Java And Xml: Links You Must Have(1)
  2. Java Multithreading Issues(2)
  3. convert .java to .c(5)
  4. How To Implement Single Instance Application On Java(0)
  5. Call Pdf995 From Java(0)
  6. I Need Help With Setting Up My Site, Made Using Java(5)
  7. Auto Run Java Program(11)
  8. Java Game(2)
  9. Java Object[][] Help(2)
  10. Java Vs Javascript(11)
  11. Hotspot Virtual Machine Exception_access_violation(4)
  12. Java Script Drop Down Menu With Css(2)
  13. Free Java Hosting?(2)
  14. The Power Of Java(14)
  15. Wysiwyg Jscript Editor(3)


 



- Lo-Fi Version Time is now: 8th October 2008 - 04:24 AM