I have an issue trying to use getServletContext() on the server-side. This is marked as an error (underlined in red) and the hover over error is "The method getServletContext() is undefined for the type MySQLConnection" and the quick fix is to create the mothod.
I am using some code that was generated by someone else for gwtJava. I am now trying to use this in a JEE project. Unfortunately I have not been able to get help from the person who originally created this code and I am not a programmer and am learning as I go.
public static void printE1(String activity, String activityNo,
String groupFormation, String location, String startTime,
String startDateString, String startFrom, String finishTime,
...
try {
ScoutMain.generateE1(getServletContext(), activity, activityNo,
groupFormation, location, startTime,
startDateString, startFrom, finishTime,
...
The ScoutMain.generateE1 has:
public static void generateE1(ServletContext ctx,
String activity, String activityNo,
String groupFormation, String location, String startTime,
...
I have looked at:
Different ways to get Servlet Context
Why getservletcontext isn't found?
And the getServletContext() documentation, which I found very confusing.
I think I may be missing an import; however, cannot find which one.