Ciao a tutti,
dopo aver fatto numerosi tentativi e ricerche non a buon fine... volevo sapere se è possibile modificare il valore di un attributo contenuto nella request. In breve...
ho una pagina iniziale test.html contenente un form:
dopo aver inviato i dati alla pagina RequestObjectInJSP.jsp,vorrei prendere il valore contenuto in txtUserName, modificarlo a piacimento in modo tale che quando eseguo il comando:codice:<html> <head><title>Request Object In JSP.</title></head> <body> <form action="RequestObjectInJSP.jsp" method="post"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td>User Name: </td> <td><input type="text" size="20" name="txtUserName" /> </tr> <tr> <td></td> <td><input type="submit" value="Submit" name="B1" /></td> </tr> </table> </form> </body> </html>mi venga visualizzato il nuovo dato.codice:request.getParameter("txtUserName");
io avevo pensato a una roba del genere:
ma non funzionacodice:<%@page import="java.util.*" %> <% String username, password, test; request.setAttribute("txtUserName", "ciao"); username = request.getParameter("txtUserName"); %> <table align="center" bgcolor="ffff00" border="1" cellspacing="0" cellpadding="0"> <tr> <td align>Your User Name: </td> <td><%=username %> </td> </tr> </table>![]()
grazie a tutti per l'aiuto

Rispondi quotando