[jboss-user] [JBoss Seam] - Getting Id of Presisted object.

2007-05-11 Thread waheed.murad
hii.

i am using entitymanger to presist Object as:

Customer cust;
em.presist(cust);

the id of customer is auto generated (in my case it is Oracle Sequence).

after presistance i want to get the id of the presisted Object. like

Customer cust;
em.presist(cust);
// Want to get the Id here;
cust.getId();


it returns null (as object is not syncronized with the database). 
thanks for you help.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4044879#4044879

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4044879
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-11 Thread waheed.murad
This is how i have used oracle sequence.

sequenceName=CUSTOMER_SEQ:  Is the name is the name of your database sequence.

name=CUSTOMER_SEQUENCE:   U will use in Entity as i have used it with id 
field.


/

@Entity
@Name(Customer)
@Scope(EVENT)
@Table(name=Customer)
@SequenceGenerator(name=CUSTOMER_SEQUENCE, sequenceName=CUSTOMER_SEQ)
public class  ERegCustomer implements Serializable
{

   private Integer id;

@Id 
   @GeneratedValue(strategy=GenerationType.SEQUENCE, 
generator=CUSTOMER_SEQUENCE)
   public Integer getId()
   {
  return id;
   }
   
   public void setId(Integer id)
   {
  this.id = id;
   }

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4044923#4044923

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4044923
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-11 Thread waheed.murad
Thanks for your reply christian

well and injecting EntityManager like this in my action class

@PersistenceContext(unitName=myDatabase)
protected EntityManager em;

i think it will not allow me to use em.flush function as i think so i have 
tried it before and it throughs exception.(As per my information it is managed 
by the seam and it does not allow it.)

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4044924#4044924

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4044924
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - WRONG_DOCUMENT_ERR Exception ???

2007-05-07 Thread waheed.murad
Hi !!!

I am using paypal for my online transactions in me seam project.

when ever i submit my form and send request to paypal, some times it works fine 
and most of the time it gives exception given below.

MESSAGE=Error: Paypal Exception occured: ; nested exception is:
org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different 
document than the one that created it

Any body have idea what the problem is ... i have also posted it on paypal but 
do not receive and responce. it may be related  to Apache Axis as it is also 
been used  at the back end.

thanks for your help or any idea related to problem


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4043623#4043623

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4043623
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: WRONG_DOCUMENT_ERR Exception ???

2007-05-07 Thread waheed.murad
well i personly also thought that it does not have to do any think with seam ? 
but just want to be confirmed that is this exception have to do any thing with 
seam request processing life cycle or not. As from exception its seems that may 
be some jsf component(which i thought it is refering as node) is missing during 
request or cannot be finded. as tree is created for jsf view.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4043628#4043628

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4043628
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - action in pages.xml help?

2007-04-27 Thread waheed.murad
hi

i am using to actions against one view-id in pages.xml i.e.

page view-id=/comm/genmailtemplate.xhtml 
action=#{EmailTemplateGeneraterAction.loadEmailTemplate} /

page view-id=/comm/genmailtemplate.xhtml 
action=#{CustomerLoginAction.loadPrivileges('GenerateMailTempSMItem')} /

problem is that only one action method is called. in my case second one 
CustomerLoginAction.loadPrivileges. i want both of them to be called. 
i am returning nothing from my action methods.

thanks in adanvce for uor help.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4041464#4041464

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4041464
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Getiing JSF ReadOnly inputText value in bankend??

2007-04-20 Thread waheed.murad
i am using jboss seam the the scope of my bean is EVENT(request) and it should 
do that as i have been doing it in other beans. may be i cannot understant 
exactly what u have said.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4039164#4039164

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4039164
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Getiing JSF ReadOnly inputText value in bankend??

2007-04-19 Thread waheed.murad
Hi.
i have readOnly inputText is JSF as

 h:inputText id=emails  value=#{myBean.emails}/ readonly=true

with backend getter and setter methods.

well when i submit form i do not have any value in my myBean.emails varaible. i 
have searched and came to know that readOnly and disabled fields are not 
decoded by JSF.
Is there any other way i can send this readOnly values to backend bean

thanks in advance.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4039131#4039131

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4039131
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Delaying ValueChangeEvent problem...

2007-03-18 Thread waheed.murad
I am queuing event when it is fired after Apply_Request_values phase for 
Update_model_value phase but it is fired first time 
during(Apply_Request_values) but not after Update_model_Values phase
   
public void changeMethod(ValueChangeEvent event)
{

PhaseId phaseId = event.getPhaseId();
String oldValue = (String) event.getOldValue();
String newValue = (String) event.getNewValue();

if (phaseId.equals(PhaseId.ANY_PHASE)){

System.out.println(Called ANY_PHASE);
event.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
event.queue();

}else if (phaseId.equals(PhaseId.UPDATE_MODEL_VALUES)){

  System.out.println(Called after UPDATE MODEL VALUES phase..);

}

}


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4029209#4029209

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4029209
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - JSF ValueChangeListener ???

2007-03-16 Thread waheed.murad
Hii...

i am using Value change listener. this event is fired after AppyRequestValues 
Phase of JSF. but i want it to be delayed and fired after UpdateModelValues. i 
am using it in my code as given below...

h:selectOneMenu id= comid onchange=this.submit() value=... 
valueChangeListener=#{MyClass.myFunction}


/h:selectOneMenu

And my backend code(myfunction):

public void myFunction(ValueChangeEvent evt){
...
...
..
}

Thanks in advance

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4028732#4028732

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4028732
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: JSF ValueChangeListener ???

2007-03-16 Thread waheed.murad
i think immediate=true is issed to fire event with out delay(i mean in early 
Phases). but however i have tried both immediate= true and immediate=false, 
both options do not work. any other opton plz..

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4028780#4028780

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4028780
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - File(data) Download problem...

2007-03-01 Thread waheed.murad
i am using seam-gen. i am trying to dowload a file or data from server as file. 
my code is 

FACELETS CODE:
h:commandButton value=donwload file 
actionListener=#{ERegReportHandlerAction.downloadReportFile}/ 

Sessionbean Function:

public void downloadReportFile(){

ExternalContext 
exContext=FacesContext.getCurrentInstance().getExternalContext();
javax.servlet.http.HttpServletResponse response = 
((javax.servlet.http.HttpServletResponse)exContext.getResponse());

//response.setContentType(application/x-download);
response.setContentType(text/plain);
response.setHeader(Content-Disposition, attachment; filename= + 
test.csv);


try{
OutputStream out = response.getOutputStream( );

byte[] arr=(This is the file data.).getBytes();
response.setContentLength(arr.length);
out.write(arr);
out.close();
}catch(Exception e){
System.out.println(Error:  + e.getMessage() );
}

}


file is downloaded but when i open it, i have the contents written by me(i.e 
This is the file data) plus the whole html page source code from where i 
pressed the download button. 
any help regarding this plz.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4024221#4024221

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4024221
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Export data..

2007-02-27 Thread waheed.murad
Hii..
i am displaying a report in my page with datatable. i want to export the report 
in to Excel. is there any tool or component to do that or any way around 

thanks in advance..

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023004#4023004

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023004
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - taglib error...

2007-02-27 Thread waheed.murad
i am using sem-gen. my facelets page has a -display tag library.

ui:composition xmlns=http://www.w3.org/1999/xhtml;
xmlns:d=http://displaytag.sf.net;

i used its compunent table as

d:table id=tableId
d:column title=ID123/d:column
d:column title=Nameabc/d:column
d:column title=Commentsnocomment/d:column
/d:table
but when i run my page instead of displaying a table it shows be just:
123 abc nocomment

when i viewed the page sourcecode in html (using view source in browser) i see 
that facelets just passed it as it was instead converting it into html i.e it 
had
d:table id=tableId
d:column title=ID123/d:column
d:column title=Nameabc/d:column
d:column title=Commentsnocomment/d:column
/d:table
as its output (Note: i then removed all the libs for it and again deployed 
the application and again same results.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023515#4023515

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023515
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: pages.xml

2007-02-14 Thread waheed.murad
i think, you can do it like this,

  | page view-id=/page.xhtml
  |navigation from-action=#{action.action}
  |rule if-outcome=success
  |redirect view-id=/viewA.xhtml
  |/rule
  |   rule if-outcome=failed
  |redirect view-id=/viewB.xhtml
  |/rule
  | /navigation-case
  |  /navigation-rule
  | 



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4016369#4016369

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4016369
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - datatable error....

2007-02-02 Thread waheed.murad
well i have my datatable binded to the DataModel and DataModelSelection. let me 
explain my problem through example plz .

my datatable first shows the followinf record when i load the page...

1
2
3
4
5

i delete the record 1 and  have on my page

2
3
4
5

now i press the back button of browser and have:

1
2
3
4
5

know if i delete 1 again what happens is next record is deleted. i.e. i have

3
4
5

i have also passed the id along the action method ,as shown below, but 
it also displays the id of the next record. 

h:commandButton value=Delete 
action=#{MyClassAction.deleteRecord(record.id)} /





View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4009962#4009962

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4009962
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Seam Remoting problem

2007-01-04 Thread waheed.murad
I am using seam remoting for AJAX but when i call my ajax method from client it 
given error

 Seam.Remoting.displayLoadingMessage = function() {};
  Seam.Remoting.hideLoadingMessage = function() {};
 
  // Get the privilege Seam component
  var RolePrivilegesAction = 
Seam.Component.getInstance(RolePrivilegesAction);


function ajaxTest(){
var test='AJAX CALL';
RolePrivilegesAction.getPrivilegesList(test,getPrivilegesListCallback);
}

function getPrivilegesListCallback(result){
alert('called ajax');
}

    STACK -

20:18:09,379 ERROR [ExecutionHandler] Error during remote request
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.remoting.Call.execute(Call.java:145)
at 
org.jboss.seam.remoting.ExecutionHandler.handle(ExecutionHandler.java:86)
at 
org.jboss.seam.remoting.SeamRemotingServlet.doPost(SeamRemotingServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at 
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.ejb.EJBException: java.lang.IllegalStateException: No page 
context active
at 
org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at 
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at 
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at 
org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at 
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at 
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at 
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at 
org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:188)
at 
org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
at $Proxy334.getPrivilegesList(Unknown Source)
at 
org.com.eventreg.ERegRolePrivilegesLocal$$FastClassByCGLIB$$e1169427.invoke()
at 

[jboss-user] [JBoss Seam] - Re: Customize validation messages

2007-01-04 Thread waheed.murad
i have also faces the same problem? i have to also go for a same solution 
required=true instead of @NotNull. is it some thing wrong with this anotation 
if not then for what exactly it is for...

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3997950#3997950

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3997950
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: how to force Logging for page access ??

2006-12-29 Thread waheed.murad
well i have solved the problem. i was reducing the code to send you , and i 
came to know that conflict was between the JSTL library  and the seam pages.xml 
action... 

thanks a lot for your help..

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3996799#3996799

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996799
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: how to force Logging for page access ??

2006-12-28 Thread waheed.murad
thanks norman richards for help
i have tried the same thing as told by u but it has some problem

This is my entry in the page.xml
page view-id=/secretquestions.jsp 
action=#{SecretQuestionsAction.checkLoggedIn} /

here is my checkLoggedIn function... 

public String checkLoggedIn(){
boolean isLoggedIn = sessionContext.get(loggedIn)!=null;
   
 if (isLoggedIn){
return null;  // Go to secretquestions.jsp.
 }else{
return loginpage; // go to login page.
 }
}

when it returns null it does not open secretquestions.jsp it opens the login 
page.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3996649#3996649

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996649
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: how to force Logging for page access ??

2006-12-28 Thread waheed.murad
i cannot understood hitting page directly . if you mean that i am  accessing by 
typing URL in the browser then it works fine it goes to login page(as i am not 
logged in) but when a login and goes to admin page given below and try to 
access the sceretquestion.jsp it still goes to login page.

i have cleared all the navigations from faces-config.xml and i only have one 
action as told before in my pages.xml 

here is my jsf page: 

%@ taglib uri=http://java.sun.com/jsf/html; prefix=h %
%@ taglib uri=http://java.sun.com/jsf/core; prefix=f %
%@ taglib uri=http://jboss.com/products/seam/taglib; prefix=s %



  
Administrator Console




  
  
  f:view
h:form

 h:commandButton id=secquestion value=Secret Question 
action=/secretquestions.jsp/   h:commandButton id=pricingops 
value=Pricing Options action=/pricingoptions.jsp/
 h:commandButton id=organization value=Organizations 
action=/customerorganizations.jsp/
 h:commandButton id=categories value=Categories action=/
 h:commandButton id=role value=Roles action=/roles.jsp/
 h:commandButton id=privileges value=Privileges 
action=/privileges.jsp/
 h:commandButton id=paymodes value=Payment Modes action=/
 h:commandButton id=currencies value=Currencies action=/

/h:form
  /f:view
  





View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3996663#3996663

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996663
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: how to force Logging for page access ??

2006-12-28 Thread waheed.murad
i shall be trying to debug by making some dummy application and the proceeding 
to my application hopefully reaching to the problem. But however thanks again 
for your help norman richards.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3996669#3996669

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996669
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: how to force Logging for page access ??

2006-12-28 Thread waheed.murad

if (isLoggedIn){ 
   System.out.println( Returing null);
return null; // Go to secretquestions.jsp. 
}else{ 
return loginpage; // go to login page. 
} 

well i have Returing null String displayed on my console so i its abvious 
that it is returning null output. i think i have do start from dummy 
application to debug it whats your suggestion

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3996670#3996670

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996670
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: how to force Logging for page access ??

2006-12-28 Thread waheed.murad
Ya i am sure because i have tried with no navigation rule in my 
faces-config.xml and only one page action in my pages.xml so i think there 
should be no other interfernces and i do not think that there is any other file 
that is part of this process..

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3996784#3996784

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996784
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - how to force Logging for page access ??

2006-12-27 Thread waheed.murad
What i want is that whenever a user access a page by typing a direct url in the 
browser e.g  http://localhost:8080/myproject/mypage.jsp; , the page should 
only be opened if user is loggedin else it should go to some other page. how 
?

i have written the interceptor as given in booking example (LoggedIn) and used 
it on the corrosponding sessionbean class but its not working fine...
it goes well when user is loggedin but in other case exception etc..


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3996573#3996573

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996573
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Problme in LoggedInInterceptor..

2006-12-27 Thread waheed.murad
This is my SessionBean class where i am using it what i am trying to achive is 
that if a user directly try to open the page by tying a URL e.g 
http://localhost:8080/ereg/secretquestions.jsp; then the LoggedInIntercepter 
should check first that user is logged in or not if not that return to some 
specific page (navigation specified in the faces-config.xml )


@Stateful
@Scope(SESSION)
@Name(SecretQuestionsAction)

@Interceptors(LoggedInInterceptor.class)

public class SecretQuestionsAction implements SecretQuestionsLocal{


@PersistenceContext(unitName=Database)
protected EntityManager em;
   
@In(required=false,value=SecretQuestions) 
@Out(required=false,value=SecretQuestions)
private SecretQuestions secretQuestions;

@DataModel 
private List  allSecretQuestionsList;

@DataModelSelection(value=allSecretQuestionsList)
private SecretQuestions selectedSecretQuestion;

@In
private Context sessionContext;

@In(create=true) 
FacesMessages facesMessages;

int mode=0;

String acknowledge = null;
/**/

public String toSecretQuestionsPage(){
System.out.println(toSecretQuestionsPage method...);
return /secretquestions.jsp;
}

public String addSecretQuestion(){

try{
if(!validateOpts()){
em.persist(secretQuestions);
secretQuestions=null;
sessionContext.remove(SecretQuestions);
getSecretQuestionsList();
acknowledge = The Record is added 
successfully.;
 }else{
 return null;
 }
   }catch(Exception e){
   System.out.println(Error Have accoured in\n\t 
SecretQuestions.java -- addSecretQuestion()? \n\t+e.getMessage());
   }
   return success;
}
/**/
public boolean validateOpts(){
boolean isError=false;
if(secretQuestions.getSecretQuestion()==){
facesMessages.add(secretQuestion,new 
FacesMessage(Please enter secret question));
isError=true;
}

return isError;
}
/**/
@Factory(allSecretQuestionsList)
public String getSecretQuestionsList(){

try{
setMode(0);
acknowledge = null;
allSecretQuestionsList = em.createQuery(from 
SecretQuestions e where e.isDeleted=0).getResultList(); 
   }catch(Exception e){
   System.out.println(Error Have accoured in\n\t 
SecretQuestions.java -- getSecretQuestionsList()? \n\t+e.getMessage());
   }
   return null;
}
/**/

public String deleteSecretQuestion(){

try{
SecretQuestions deleted = 
em.find(SecretQuestions.class, selectedSecretQuestion.getId()); 
if(deleted != null){ 
deleted.setIsDeleted(1);
}
deleted = null;
sessionContext.remove(SecretQuestions);
secretQuestions=null;
getSecretQuestionsList();
acknowledge = The Record is deleted 
successfully.;
System.out.println(getting the result list 
complete \n\t);

}catch(Exception e){
System.out.println(Error Have accoured in\n\t 
SecretQuestions.java -- deleteSecretQuestion()? \n\t+e.getMessage());
}   

return null;
}
/**/

public String updateSecretQuestion(){
try{
em.merge(secretQuestions);
setMode(0);
getSecretQuestionsList();
acknowledge = The record is updated successfully;

}catch(org.hibernate.validator.InvalidStateException e){
System.out.println(e.getMessage());
System.out.println(error...);

[jboss-user] [JBoss Seam] - Problme in LoggedInInterceptor..

2006-12-26 Thread waheed.murad
I am developing a  LoggedInInterceptor  but problem with it is that when i 
return the string it does not functon properly 
Interceptor code is here:
--

@Interceptor(around={BijectionInterceptor.class, ValidationInterceptor.class, 
ConversationInterceptor.class, BusinessProcessInterceptor.class},
 within=RemoveInterceptor.class)
 
public class LoggedInInterceptor{

   @AroundInvoke
   public Object checkLoggedIn(InvocationContext invocation) throws Exception{
  
  System.out.println(LoggedInInterceptor...);
  
  Method m=invocation.getMethod();

  boolean isLoggedIn = Contexts.getSessionContext().get(loggedIn)!=null;
  
 if (isLoggedIn){
return invocation.proceed();
 }else{
return loginpage;
 }
  }
   
}

when it return loginpage it seems that instead of going to login page it is 
trying to go on the same page actionbean on which it was invoked...

navigation rule in faces-config.xml is

navigation-rule
  navigation-case
 from-outcomeloginpage/from-outcome
to-view-id/eregindex.jsp/to-view-id

   /navigation-case
/navigation-rule

any help plzzz
thanks in advance...

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3996386#3996386

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996386
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: @NotNull annotation not working...

2006-12-19 Thread waheed.murad
well i have understood the problem but cannot find solution for it.. well i 
have 

h:outputText in my JSF page as

h:inputText id=username value=#{customer.username}

which is mapped to the Entity bean

Entity
@Name(customer)
@Scope(SESSION)
@Table(name=ERegCustomer)
@SequenceGenerator(name=CUSTOMER_SEQUENCE, sequenceName=EREGCUSTOMER_SEQ)
public class  ERegCustomer implements Serializable
{

   private static final long serialVersionUID = 1881413500711441953L;

   private Integer id;
   private String username;
   private String password;




And my session bean as
public class ERegCustomerAction implements ERegCustomerLocal  {

@In
private Context sessionContext; 

@In(required=false) 
@Out(required=false)
private ERegCustomer customer;

public String registerCustomer()
{
 ...
 .
 .  /// here customer.getUsername returns empty String not 
null

when i submit the form with empty field,  customer.username have value. 
i mean it is assigined to empty string () not to null so abviously @NotNull 
anotation will not work. if this is the case then for what @NotNull is used for 
and if i am right then what mistake i made

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3994911#3994911

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3994911
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Hibernate annotation source code

2006-12-19 Thread waheed.murad
i want to download the source code of hibernate and in specific source code of 
org.hibernate.validator package some one can help me plz 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3995087#3995087

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3995087
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Problem in writing own annotation in seam

2006-12-19 Thread waheed.murad
I want to have my own Hibernate annotaion validator.. named NotEmpty a 
problem is that when after form submition the only initialize() method is 
called. isValid() method does not executes.. 

below is the code and Thanks in advance for help.. 


- Annotation descriptor --- 
import java.lang.annotation.Documented; 
import java.lang.annotation.ElementType; 
import java.lang.annotation.Retention; 
import java.lang.annotation.RetentionPolicy; 
import java.lang.annotation.Target; 
import org.hibernate.validator.ValidatorClass; 


@ValidatorClass(value=NotEmptyValidator.class) 
@Target(value={ElementType.METHOD,ElementType.FIELD}) 
@Retention(value=RetentionPolicy.RUNTIME) 
@Documented 

public @interface NotEmpty { 
String message() default Field cannot be empty; 
} 

- Annotation validator --- 

import org.hibernate.validator.PropertyConstraint; 
import org.hibernate.validator.Validator; 

import java.io.Serializable; 

public class NotEmptyValidator implements Validator, PropertyConstraint, 
Serializable { 


public boolean isValid(Object value) { 
System.out.println( is Valid method called...); 
.. 
.. 
return false; 
} 

public void initialize(NotEmpty parameters) { 
System.out.println( Initialize method called...); 
} 

public void apply(org.hibernate.mapping.Property property){ 
System.out.println( Apply method called...); 
} 

} 




View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3995089#3995089

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3995089
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Problem in writing own annotation in seam

2006-12-19 Thread waheed.murad
No it do not have any value when form is submited and  it POJO mapped attribute 
contains  (empty String) in it. i want to perform  validation for this empty 
String.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3995205#3995205

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3995205
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Problem in writing own annotation in seam

2006-12-19 Thread waheed.murad
is it possible to perform validation on empty fields (fields which have  
String)  

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3995206#3995206

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3995206
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - @NotNull annotation not working...

2006-12-18 Thread waheed.murad
i am working on registration form and i want that user cannot submit empty 
fields. i have marked the corresponding fields with @NotNull annotation in the 
Entity POJO but its not working. Other annotations @length etc are working 
fine. when form is submitted with empty fields, the session bean method is 
invoked and i have the following errors.


00:18:40,095 INFO  [STDOUT] Hibernate: select EREGCUSTOMER_SEQ.nextval from dual
00:18:40,563 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces 
Servlet threw exception
javax.faces.FacesException: Error calling action method of component with id 
registercustomerform:create
at 
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at 
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
at 
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
at 
org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
at 
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at 
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.faces.el.EvaluationException: Exception while invoking 
expression #{customerAction.registerCustomer}
at 
org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
at 
org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
at 
org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:71)
at 
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
... 27 more
Caused by: java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: 
Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=liberty/31, 
BranchQual=, localId=31] status=STATUS_NO_TRANSACTION; - nested throwable: 
(javax.persistence.PersistenceException: 
org.hibernate.validator.InvalidStateException: validation failed for: 
org.com.pojo.ERegCustomer)
at 
org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:180)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
at 
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at 
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at 
org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
at 

[jboss-user] [JBoss Seam] - Re: @NotNull annotation not working...

2006-12-18 Thread waheed.murad
thanks Stephan for quick reply.

if i will add  required=true to the form input components then it will be 
checked by the JSF not by Jboss Seam or hibernate validators (in my case 
@NotNull) i want the validation to be performed on server side through 
annotations on my Entity bean.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3994899#3994899

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3994899
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user