A variable is based to my servlet and a lookup is preformed in the database. Depending on what this variable is a class is loaded. I've written an abstract to handle all this. When I was testing I didn't use a servlet initially but instead wrote a main and tested on the command line to make sure the lookup and creation was working. This test file began with:
public class TestUser extends DecisionCreator
public static void main(String args)
Where DecisonCreator is:
public abstract class DecisionCreator
protected static Decision createDecision(String name) throws DecisionNotCreatedException
Class DecisionClass = Class.forName(name);
myDecision = (Decision) DecisionClass.newInstance();
Decision is a simple interface:
public interface Decision
String launch(String user);
When I went to put use my code in the servlet I came up against this problem. My servlet is called Link:
public class Link extends HttpServlet
I cannot extend DecisionCreator as I did in my test file. Is there a solution to this or do I have to re-design everything?
If anything is not clear please let me know
Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop.
Define While Loop:
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts.
Introduce Scanner class: