parsing parameter from jsp to file (DEBIAN)

I need to get parameter from input that i send from JSP.

<input type="text" name="id">

After that i need to place “id” to a file, how can i do that ? i have test

String idp = request.getParameter("id");
        String s;
    Process p;

        p = Runtime.getRuntime().exec("/var/tmp/userbaru.ldif"+idp);
        BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
            System.out.println("Line: "+s);
        System.out.println("Exit: "+p.exitValue());
    }catch(Exception e){}

In other way i want a result like this , i send an id with name mike, and after i open my file an it will be mike.

<%=idp%> that what i have test on a file , and cant

just want to change mirko to “idp”(variable that i get from JSP)

    dn: cn=**mirko**,ou=group,dc=dtn,dc=com
cn: **mirko**
gidNumber: 20000
objectClass: top
objectClass: posixGroup

dn: uid=**mirko**,ou=people,dc=dtn,dc=com
uid: **mirko**
uidNumber: 20000
gidNumber: 20000
cn: **Mirko**
sn: **Mirko**
objectClass: top
objectClass: person
objectClass: posixAccount
objectClass: shadowAccount
loginShell: /bin/bash
homeDirectory: /home/**mirko**

If there is another solution, please tell me , Thank You

Source: jsp

Leave a Reply