Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to pass array in the url of the servlet

843841Jul 13 2007 — edited Jul 14 2007
Hi Friends,
How can i pass an array in the URL that calls a servlet. For instance,I have this in my servlet rite now:
        MyClass obj = new MyClass();
        String[] args = {"-opt1","-opt2","file1","file2","file3"};
        obj.main(args);
I want that the "args" should come in the URL call,because some php application would be calling this, for instance:
http://localhost:8080/MyProject/MyServlet?args=somearray

      MyClass obj = new MyClass();
      String[] arg = request.getParameter("args");
      obj.main(arg);
Please help..I would really appreciate it.
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2007
Added on Jul 13 2007
8 comments
191 views