简体   繁体   中英

How do I pass an argument to a Google App Engine servlet?

I created a servlet that sends email alerts on a specified condition. the users can set alerts through the gui on the main page, but i want to give them the option of unregistering in each email thats sent. i want to include something like this in the email:

If you'd like to unregister for this alert, please go to http://mysite.com/myUnregisterServlet?id=uniqueID

where uniqueID would be the alerts unique key (there can be many different alerts set for 1 email).

how can i accomplish this, or something to this effect? Thank you!

@Override
public void doGet(final HttpServletRequest req, final HttpServletResponse resp)
  throws IOException, ServletException
{
  final String id = req.getParameter("id");
  ...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM