troubleshooting Question

compiling error (cannot reslove sysmbol)

Avatar of asdflkjadsf
asdflkjadsf asked on
3 Comments1 Solution197 ViewsLast Modified:
I have get the following error when compiling.  Could someone provide me with a working solution?

FYI: The rt.exec only works when I put the variables into an array. cannot resolve symbol
symbol  : variable args
location: class ThreeParams
            FileOutputStream fos = new FileOutputStream(args[0]);
1 error

import javax.servlet.http.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class ThreeParams extends HttpServlet {
  public void doGet(HttpServletRequest request,
                    HttpServletResponse response)
      throws ServletException, IOException {
    PrintWriter out = response.getWriter();
    String title = "Reading Three Request Parameters";
    out.println(ServletUtilities.headWithTitle(title) +
                "<BODY BGCOLOR=\"#FDF5E6\">\n" +
                "<H1 ALIGN=CENTER>" + title + "</H1>\n" +
                "<UL>\n" +
                "  <LI><B>param1</B>: "
                + request.getParameter("Name") + "\n" +
                "  <LI><B>param2</B>: "
                + request.getParameter("Text") + "\n" +
                "  <LI><B>param3</B>: "
                + request.getParameter("Date") + "\n" +
                "</UL>\n" +

        String Date = request.getParameter("Date");
        String command = "/scripts/";
        String Text = request.getParameter("Text");
        String cmd[] = new String[3];
            FileOutputStream fos = new FileOutputStream(args[0]);
            Runtime rt = Runtime.getRuntime();
            Process proc = rt.exec(cmd);
Mayank S
Principal Technologist

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros