[JBoss Seam] - Re: trouble using password verify as in booking example
by henrik.lindberg
And here is the register.xhtml (Sorry for all the {} instead of normal lt/gt 'XML brackets' - the forum software choked on this otherwise - I hope you can read it - it is truly boiler-plate code (I chopped off the standard stuff at the beginning of the file.
{ui:define name="body"}
{f:view}
{h:form}{fieldset}
{table border="0" class="formTable"}
{col class="labelCol"/}
{col class="inputCol"/}
{s:validateAll}
{tr}
{td}{h:outputLabel for="login"}Username (login):{/h:outputLabel}{/td}
{td}{h:inputText id="login" value="#{user.login}" required="true"/}{/td}
{/tr}
{tr}
{td}{h:outputLabel for="realName"}Real Name:{/h:outputLabel}{/td}
{td}{h:inputText id="realName" value="#{user.realName}" required="true"/}{/td}
{/tr}
{tr}
{td}{h:outputLabel for="password"}Password:{/h:outputLabel}{/td}
{td}{h:inputSecret id="password" value="#{user.password}" required="true"/}{/td}
{/tr}
{tr}
{td}{h:outputLabel for="verify"}Verify Password:{/h:outputLabel}{/td}
{td}{h:inputSecret id="verify" value="#{register.verify}" required="true"/}{/td}
{/tr}
{tr}
{td}{h:outputLabel for="email"}Email:{/h:outputLabel}{/td}
{td}{h:inputText id="email" value="#{user.email}" required="true"/}{/td}
{/tr}
{/s:validateAll}
{/table}
{h:messages/}
{h:commandButton type="submit" value="Register" action="#{register.register}"/}
{/fieldset}
{/h:form}
{/f:view}
{/ui:define}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008599#4008599
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008599
19 years, 2 months
[JBoss Seam] - Re: trouble using password verify as in booking example
by henrik.lindberg
Sorry, I need to what? Do you mean post some code?
Here is the register action (sans imports)
@Stateful
@Scope(EVENT)
@Name("register")
public class RegisterAction implements Register
{
@In @Out
private User user;
@PersistenceContext
private EntityManager em;
@Logger
private Log log;
private String m_verify;
public String register()
{
if(!user.getPassword().equals(m_verify))
{
FacesMessages.instance().add("Password mismatch - please try again");
this.m_verify = null;
return null;
}
if(!User.exists(em, user.getLogin()))
{
em.persist(user);
log.info("Registered new user #{user.login}");
return "/registered.seam";
}
FacesMessages.instance().add("User #{user.login} already exists! Choose a different login.");
return null;
}
public String getVerify()
{
return m_verify;
}
public void setVerify(String verify)
{
this.m_verify = verify;
}
@Destroy
@Remove
public void destroy()
{
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008598#4008598
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008598
19 years, 2 months
[Beginners Corner] - Log4j Custom Logger with RepositorySelector
by arena
I followed the instructions mentioned on the jboss wiki site for writing custom logger component for your web application i.e implementing the RepositorySelector. It works fine when i deploy only one application. We have two application that needs to be deployed on the same instance. When i deploy both the application, its not writing anything to log files(although some people saying its writing to log files created by the very first deployed application). I am unable to figure out, Can one of you please help me with this issue. Your help is highly appreciated. Here is my log4j.xml for both my application and ApplicationLogger which implements RepositorySelector
Thanks
----First Application Log4j.xml ----
log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<!-- Categories for logging -->
<appender-ref ref="GAGE" />
<appender-ref ref="GAGE" />
<appender-ref ref="TORQUE" />
<appender-ref ref="AXIS" />
<!-- Setup the Root category -->
<appender-ref ref="ERROR"/>
</log4j:configuration>
----Second Application Log4j.xml ----
log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<!-- Categories for logging -->
<appender-ref ref="ADMIN" />
<appender-ref ref="ADMIN" />
<appender-ref ref="ADMIN_TORQUE" />
<appender-ref ref="ADMIN_AXIS" />
<!-- Setup the Root category -->
<appender-ref ref="ADMIN_ERROR"/>
</log4j:configuration>
-------ApplicationLogger ----------------
public class ApplicationLogger implements RepositorySelector {
private Hashtable repositories;
private static ApplicationLogger instance;
public void destroy() {
Enumeration keys = repositories.elements();
while (keys.hasMoreElements()) {
Object keyName = keys.nextElement();
repositories.remove(keyName);
}
}
// load log4j.xml from WEB-INF
private void loadLog4JConfig(Hierarchy hierarchy, String log4jxml)
throws IOException, ParserConfigurationException, SAXException {
FileInputStream log4JConfig = new FileInputStream(log4jxml);
Document doc = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().parse(log4JConfig);
DOMConfigurator conf = new DOMConfigurator();
conf.doConfigure(doc.getDocumentElement(), hierarchy);
}
/**
*
* @return logger hierarchy for refreshing the logger instance
*/
public Hashtable getRepositoryTable() {
return repositories;
}
public static ApplicationLogger getInstance(String log4jxml)
throws IOException, SAXException, ParserConfigurationException {
if (instance == null) {
instance = new ApplicationLogger(log4jxml);
}
return instance;
}
private ApplicationLogger(String log4jxml) throws IOException, SAXException,
ParserConfigurationException {
repositories = new Hashtable();
Hierarchy hierarchy = new Hierarchy(new RootCategory(Level.DEBUG));
loadLog4JConfig(hierarchy, log4jxml);
ClassLoader cl = Thread.currentThread().getContextClassLoader();
repositories.put(cl, hierarchy);
}
public LoggerRepository getLoggerRepository() {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Object repository = repositories.get(loader);
if (repository == null) {
repository = new Hierarchy(new RootCategory((Level) Level.DEBUG));
repositories.put(loader, repository);
}
return (Hierarchy) repository;
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008591#4008591
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008591
19 years, 2 months
[Beginners Corner] - Re: connecting to JBOSS and TOMCAT will die
by jailau_24
Additional problem comes out on our system. Just to give background we have a content provider located in different network. Their application server is a Linux JBOSS server. Our APP00-202.163.229.51 will connect to their JBOSS Server-192.168.1.216 everytime there's a bets comes in to the system, the APP00 Linux Tomcat service died on this processed.
Please see attached information
===================START=======================
[Live MO/MT]
MO Traffic
Jan 25, 2007 19:45:15 SMART.7168 7168 639189396931 MagicFive M5
M5 5 25 3 7 36 G
MT Traffic
Jan 25, 2007 19:45:26 SMART.7168 7168 639189396931 MagicFive M5
M5: Sorry, request could not be processed at the moment. Please wait for further announcements.
[APP00 console]
[root@app00 log]# date ; service tomcat status
Thu Jan 25 19:46:58 PHT 2007
Tomcat is dead but subsys is locked
[APP00.vas.tssph.com 202.163.229.51 MOMASRV.LOG]
* What's this error means ?
2007-01-30 15:54:45,534 [SMPPDriver:smart-smpp] ERROR com.mwise.MMSentre.composers.ComposerIf - Bad karma from Java's Charset, conve
rting from US-ASCII to UTF-8:
java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:260)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:763)
at com.mwise.MMSentre.composers.ComposerIf.charsetConvert(ComposerIf.java:167)
at com.mwise.MMSentre.drivers.SMPPDriver.readMessage(SMPPDriver.java:865)
at com.mwise.MMSentre.drivers.SMPPDriver.handleDeliverSM(SMPPDriver.java :796)
at com.mwise.MMSentre.drivers.SMPPDriver.handlePDU(SMPPDriver.java:638)
at com.mwise.MMSentre.drivers.SMPPDriver.handleEvents(SMPPDriver.java:457)
at com.mwise.MMSentre.drivers.SMPPDriver.run(SMPPDriver.java :362)
at java.lang.Thread.run(Thread.java:534)
thank you
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008586#4008586
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008586
19 years, 2 months