Hi All:
I’m a PHP programmer who’s new to I’m new to Java and JSP as a whole and am having some difficulties understanding some seemingly basic concepts.
Is a “servlet” essentially a compiled application that sits on a server that a JSP script can interact with? i.e. if I built a servlet that could handle addition - I could pass two numbers to a servlet and it will spit back ?
Also, pardon my ignorance but - what is an “action”(as it relates to Struts2)? I ask because I am trying to figure out the process of how this code works. I have a piece of HTML that links to “/go/login” - which the location is defined in a struts-config.xml file as an action with a type of a method (com.xxx.xxx…) - which then redirects the browser t a URL that it builds (including data tacked on to the URL originally to pass via GET)…
I need to change this to POST instead of GET… is that terribly difficult? It seems as much.
Essentially I have:
String data1Key=“Data1Name”;
String data2Key=“Data2Name”;
String data1 = datasource.getData1();
String data2 = datasource.getData2();
String urlToPost = datasource.postingURL();
and need to (I made up my own syntax, but I think you may get the idea
)
response.sendRedirectViaPost(urlToPost, (data1Key => data1, data2Key => data2));
Thanks,
Matrocka