Monday, May 31, 2010

How to read web.xml parameters from GWT


How do I read parameters stored in /WEB-INF/web.xml from my
GreetingServiceImpl class?

After I insert following snipplet int web.xml:


Is anything like this possible:

public class GreetingServiceImpl extends RemoteServiceServlet
implements GreetingService {
public String greetServer(String input) throws
IllegalArgumentException {
Series<Parameter> parameters = getContext().getParameters();
String strHost = parameters.getFirstValue("dbHost");
String strName = parameters.getFirstValue("dbName");
return "The target database is " + strName + "@" + strHost;

Thanx for your help and cheers!


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment