Marcelo Heitor

Greenhorn
+ Follow
since Aug 20, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Marcelo Heitor

Hi folks!

I have one web service created in java that it needs to receive one dataset that was developed in .net.
More necessarily the archive xml that it is generated by dataset.
After to receive this xml, necessary to record it in the database.

Somebody can give an aid to me?
17 years ago
Ok Ransika deSilva, I go to study jsr's, the notes that you it indicated and the book that I cited before, therefore it I already I bought. Thanks for help-me!!!
Hello folks!
The book "Beginning J2ME From Novice..." is enough for certification SCMAD? Or I will have that to read all the JSRs referring CLDC 1,0 and 1,1, MIDP 2,0, WMA, MMAPI?
Hello folks,
after click in "Tomcat Administration", I receive the follow message:

Tomcat�s administration web application is no longer installed by default. Download and install the "admin" package to use it.

ho do resolve this?
18 years ago
Hi,

I have to do a j2me application under Windows CE 4.2. This application will have to generate a bar code and send it to a bluetooth printer.

I have some doubts:

Which Virtual Machine is the best choice to install under win ce 4.2? I know only the WEME of IBM. I need a JVM that supports jsr 82 (Bluetooth api).

Have I to buy a Bluetooth api? Or a api to print using a bluetooth printer?

Is there an api to generate bar code?

Should I use CDC? or CLDC?

Help,
Marcelo.
18 years ago
Hi,

I'm working with http connection with a midlet.
I have to download a archive and When I test using a server in a private domain, all works perfect.

But when I test using a server on a external domain, I get a javax.microedition.io.ConnectionNotFoundException: TCP open.

So I tested the URL of archive on the external server in the browser, I have got the archive.

Help,
Please.
18 years ago
Hello folks,

How to calculate the time (miliseconds) of response of a request (servlet)?
18 years ago
ops...
...thanks, thanks...
19 years ago
thanks, tanks, tanks my friend
it was this same that it was lacking
19 years ago
Help folks
I am new in the struts and...
What is wrong in that code?

package pacotes;
imports...
public class ValidacaoUsuario extends ActionForm{

private String usuario;
private String senha;

... getters and setters...

public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ((usuario == null) || (usuario.length() < 1))
errors.add("username", new ActionError("error.username.required"));
return errors;
}
}

/*******************************************/
content of application.properties, he is in the package resources

error.username.required=<LI>Username is required</LI>

/*******************************************/
content of STRUTS-CONFIG.XML

<struts-config>
<form-beans>
<form-bean name="validacaoForm"
type="pacotes.ValidacaoUsuario" />
</form-beans>
<action-mappings>
<action path="/validar"
type="pacotes.UsuarioAction"
name="validacaoForm" scope="request"
validate="true" input="/validacao.jsp">
<forward name="show_menu" path="/menu.jsp" />
</action>
</action-mappings>
<message-resources parameter="resources.application"/>
</struts-config>

/*******************************************************************/
jsp that I need that shows the message in case the user doesn't fill out the field user

<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>

<body>
<form name="form1" action="validar.do" method="post">
Username:<input name="usuario" type="text" id="usuario">
Password:<input name="senha" type="text" id="senha">
<input type="submit" name="Submit" value="Ok">
</form>
</body>

I believe that it is lacking something in that page, but I don't know what is.

Excuse the size of the message
Marcelo Heitor - Bras�lia - Brazil
19 years ago
yes, for example...

import java.sql.Types;
import java.util.Vector;

import javax.naming.InitialContext;
import javax.sql.DataSource;

import br.df.gov.caesb.seguranca.RegistrarLog;

/**
* Descri��o: Classe que cont�m os resultados de uma pesquisa realizada no Banco
* de Dados
*/
public class Container implements Serializable {

/**
* Indica a listagem de conex�es ativas
*/
private static Vector listaConexao = new Vector();

/**
* Indica o objeto que reter� o pool de conex�es
*/
private static DataSource ds;

/**
* Indica o objeto Statement
*/
private static Statement sttm;

/**
* Indica o nome do recurso JNDI recuperado pelo Listener
*
*/
private static String fonteDados;

/**
*
*/
public Container() {
}

/**
* M�todo utilizado para realizar uma pesquisa no Banco de Dados abrindo: um
* canal de conex�o e um espa�o destinado ao resultado da consulta. Throws
* SQLException
*
* @param sql
* String
* @result ResultSet
* @see java.sql.ResultSet *
* @see java.sql.Connection
* @see java.sql.Statement
* @see java.sql.ResultSet
*/
public static Connection getConnection() throws SQLException {
try {
InitialContext initialcontext = new InitialContext();
ds = (DataSource) initialcontext.lookup(Container.getFonteDados());
Connection conn = ds.getConnection();
conn.setAutoCommit(false);
return conn;

} catch (javax.naming.NamingException e) {
RegistrarLog.log(RegistrarLog.ERRO,
"Um problema ocorreu ao recuperar o objeto DataSource.\n"
+ e.toString());

return null;
}
}
19 years ago
Hello folks, I have the problem.

all the class implement serializable and exactly thus it continues this problem.

I am using SecurityFilter.

somebody can help me?


exception

javax.servlet.ServletException: Error matching patterns
org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:148)


root cause

java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1233)
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:129)
org.securityfilter.filter.SecurityRequestWrapper.setUserPrincipal(SecurityRequestWrapper.java:234)
org.securityfilter.authenticator.FormAuthenticator.processLogin(FormAuthenticator.java:200)
org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:138)
19 years ago
Folks, the code started to function suddenly, is stranger... but OK. I am thankful for the help!!!


Marcelo Heitor
Bras�lia - Brazil
Hello folks,

I have a doubt on the chapter 12 of the book Head-First Servlets and JSP, I tried to do an authentication example in agreement with the book but I don't get to call the standard form of the browser, it follows the example

in tomcat-users.xml ********************************************
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="Guest"/>
<role rolename="Adm"/>
<role rolename="Member"/>
<user username="Annie" password="admin" roles="Adm,Member,Guest"/>
<user username="Diane" password="coder" roles="Member,Guest"/>
<user username="Ted" password="newBie" roles="Guest"/>
</tomcat-users>


in web.xml in my application, called Beer *********************************

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

version="2.4">

<servlet>
<servlet-name>teste</servlet-name>
<servlet-class>AddRecipe.servletTeste</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>teste</servlet-name>
<url-pattern>/t.do</url-pattern>
</servlet-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>UpdateRecipes</web-resource-name>
<url-pattern>/Beer/*</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>Admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<realm-name></realm-name>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>Adm</role-name>
</security-role>

</web-app>


and it follows the structure of pastes used in the application ************
-->webapps
-->Beer (with. jsp that calls a servlet through method get)
-->WEB-INF (with web.xml)
-->classes
-->AddRecipe (with servlet.class)

obs: It�s works, but I don't get to call the form of authentication of the browser