I am new to GAE and Java servlets. I created a Java web application on
Eclipse as a Dynamic Web Project, which works perfectly. But now I am
trying to port to GAE. The whole application basically has two parts:
a) The front page (index.html) - it has three text boxes where people can
enter any text there.
b) The second page - getlist.html (resulting from the servlet) - this page
is created by the Java servlet.
Basic behavior is as follows:
1) The user goes to the front page and enters three shopping items (e.g.
XBox, iPhone, iPad) and clicks on the "submit" button
2) On clicking the "submit" button, the user is directed to the
getlist.html page, where he sees his shopping list (e.g. XBox, iPhone,
iPad) - the same items he listed on the front page.
Basically, I created the servlet that takes the text entered in the 1st
page as parameters and shows them in the 2nd page (like a form submission).
To do that, on the index.html file, on "submit" button, I have the
following code, followed by the text boxes and submit button:
> <form name="input" ACTION="getlist">
>
where, "getlist" calls the "getlist" servlet to fire up.
Then, I wrote the servlet part and named it "getlist" as I want that
servlet to fire it up when I click the "submit" button and process my input
from index.html and generate an output to "getlist.html" page. So, in my
"GetList" class I have the follow snippet:
> @WebServlet("/getlist")
>
> public class GetList extends HttpServlet {}
>
>
Now my questions are:
a) I realized that GAE supports only servlet-api.jar version 2.5, so
"@WebServlet("/getlist") throws error for me. What can I do about that? How
do I identify that servlet as the "getlist" servlet to be called from my
index.html page?
b) The "submit" button on index.html no longer prompts the GetList class to
run. In fact, when I run my GAE web application, it only runs the "GetList"
class (and not the index.html) to start things off. So my question would
be, what should I be doing to make the above scenario work with GAE? May
be the better questions can be i) how do I call one servlet from another,
or ii) how do I call the "getlist" servlet from a "submit" button in GAE,
like I am being able to do in Eclipse as a Dynamic Web Project?
I'm still new to all this, so I am learning. So feel free to let me know if
there is a better way to handle all this.
Thanks!
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine-java/-/q7N5euG-Y6AJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.