|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
pt.moredata.connection.taglibs.CreateDataSourceServlet
CreateDataSourceServlet.java Controlador para uma pagina de login a base de dados em jsp. Company MoreData
| Field Summary | |
protected DataSource |
_dataSource
DataSource criado por esta servlet. |
protected java.lang.String |
_errorMessage
Menssagem de erro. |
protected javax.servlet.http.HttpServletRequest |
_request
HttpServlet Request Object. |
protected java.lang.String |
_userId
Nome do utilizador |
static java.lang.String |
DATASOURCE_KEY
Chave usada para guardar o DataSource. |
static java.lang.String |
DRIVER_KEY
Driver usado para criar a connecao via JDBC. |
static java.lang.String |
ERRORMESSAGE_KEY
Menssagem de erro que deve ser apresentada em caso de erro. |
static java.lang.String |
ERRORPAGE_KEY
Pagina de erro que deve ser apresentada em caso de erro. |
static java.lang.String |
PASSWORD_KEY
Chave usada para guardar a password. |
static java.lang.String |
STARTPAGE_KEY
Pagina inicial para onde se deve fazer forward apos criado o DataSource. |
static java.lang.String |
URL_KEY
URL usado para criar a connecao via JDBC. |
static java.lang.String |
USERID_KEY
Chave usada para guardar o nome do utilizador. |
| Fields inherited from interface pt.moredata.connection.ConnectionConfig |
CANCEL, DEFAULT_SOURCE_NAME, ERROR, OK |
| Constructor Summary | |
CreateDataSourceServlet()
|
|
| Method Summary | |
void |
destroy()
Destroys the servlet. |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP GET method. |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP POST method. |
protected void |
forwardRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String forwardTo)
Redireciona o pedido para uma dada pagina. |
java.lang.String |
getDataSourceId()
Devolve a identicacao da configuracao. |
java.lang.String |
getDebug()
Devolve o nome da base de dados. |
java.lang.String |
getDriver()
Devolve o nome complemto da classe que implementa o driver de JDBC. |
java.lang.String |
getPassword()
Devolve a palavra chave para aceder a base de dados. |
java.util.Properties |
getProperties()
Devolve um objecto com propriedades a usar na criacao da conexao. |
java.lang.String |
getServletInfo()
Returns a short description of the servlet. |
java.lang.String |
getURL()
Devolve uma String com o URL para establecer a conecao via JDBC. |
java.lang.String |
getUserId()
Devolve o nome do utilizador para aceder a base de dados. |
protected void |
initDataSource()
Description of the Method |
int |
loadConfig()
Carrega do ficheiro de configura�ao a informacao para aceder a base de dados. |
protected void |
processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes requests for both HTTP GET and POST
methods. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String USERID_KEY
public static final java.lang.String PASSWORD_KEY
public static final java.lang.String URL_KEY
public static final java.lang.String DRIVER_KEY
public static final java.lang.String STARTPAGE_KEY
public static final java.lang.String ERRORPAGE_KEY
public static final java.lang.String ERRORMESSAGE_KEY
public static final java.lang.String DATASOURCE_KEY
protected DataSource _dataSource
protected javax.servlet.http.HttpServletRequest _request
protected java.lang.String _userId
protected java.lang.String _errorMessage
| Constructor Detail |
public CreateDataSourceServlet()
| Method Detail |
protected void initDataSource()
protected void forwardRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String forwardTo)
throws java.io.IOException,
javax.servlet.ServletException
request - Pedido feito pelo cliente.response - Resposta a dar ao cliente.forwardTo - Url da pagina para onde redirecionar o
pedido.
java.io.IOException - Description of the Exception
javax.servlet.ServletException - Description of the Exception
protected void processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
GET and POST
methods.
request - servlet requestresponse - servlet response
javax.servlet.ServletException - Description of the Exception
java.io.IOException - Description of the Exception
protected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
GET method.
request - servlet requestresponse - servlet response
javax.servlet.ServletException - Description of the Exception
java.io.IOException - Description of the Exception
protected void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
POST method.
request - servlet requestresponse - servlet response
javax.servlet.ServletException - Description of the Exception
java.io.IOException - Description of the Exceptionpublic void destroy()
destroy in interface javax.servlet.Servletpublic java.lang.String getServletInfo()
getServletInfo in interface javax.servlet.Servletpublic java.lang.String getDataSourceId()
ConnectionConfig
getDataSourceId in interface ConnectionConfigpublic java.lang.String getDebug()
ConnectionConfig
getDebug in interface ConnectionConfigpublic java.lang.String getDriver()
ConnectionConfig
getDriver in interface ConnectionConfigpublic java.lang.String getPassword()
ConnectionConfig
getPassword in interface ConnectionConfigpublic java.lang.String getURL()
ConnectionConfig
getURL in interface ConnectionConfigpublic java.lang.String getUserId()
ConnectionConfig
getUserId in interface ConnectionConfig
public int loadConfig()
throws java.io.FileNotFoundException
ConnectionConfig
loadConfig in interface ConnectionConfigjava.io.FileNotFoundException - Caso o ficheiro de configuracao nao seja
encontrado.public java.util.Properties getProperties()
ConnectionConfig
getProperties in interface ConnectionConfig
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||