Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!

Omar Barrera

Greenhorn
+ Follow
since Aug 17, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Omar Barrera

Hello All,

I have been writing a portlet application using MyFaces 1.1.5, Java 5 with uPortal 2.5.3. I have been somewhat successful in getting the application to work inside of uPortal, but I have hit a snag. Whenever I use a MyFaces selectonemenu component and use the getter and setter methods along with the jsp action, the backing bean and the selected item in the list do not bind, the result is a null. For curiosity sakes, I created a normal application out of my code and the component getter/setter method works as expected. Are there any considerations that I have overlooked to use JSF/MyFaces in a portlet? Any ideas or insight greatly appreciated.

Regards,

Omar
13 years ago
Hello Sachin, thank you for responding promptly. I am using MyFaces 1.1.5 and java 5. Unfortunately I am not at liberty to post my jsp page. I appreciate your response on this matter. However I will say that my other jsf components are binding with the component via the jsf api properly. This leads me to believe that there is some weird behavior occurring because of the portlet container I am using. Very discouraging, but I will continue to try and isolate the problem.

Kind Regards,

Omar
13 years ago
JSF
I need some help with an issue that is driving me mad. I have a state list populated by a bean. I have my form, and it displays correctly. However, the value selected in the list is never saved. I can not figure out what is wrong with my code. FYI, I am using the MyFaces implementation of JSF. Here is my code.

statebean



13 years ago
JSF
I was able to get my code to run partially correct. However I am still having an issue binding the selectonemenu item that is selected from the jsp view to the information in the bean. Again, forgive my ignorance as I am new to JSF, 1st project btw, but I thought if used the value element in the selectonemenu component tag, then the value the user selects would be bound by the get and set methods of the underlying bean.

Omar
13 years ago
JSF
What I noticed in my code is that I initialized state_ to null. So I corrected that and am now getting another error. The error I am getting is Caused by: java.lang.NoSuchMethodError:

Here is a copy of the class I am using:

When I am calling the getSelectedState method from the bean I am getting
Caused by: java.lang.NoSuchMethodError: stateBean.getState()Ljava/lang/String;




Caused by: javax.faces.FacesException: Error calling action method of component with id _idJsp0Pluto_264_:SaveButton
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
at javax.faces.component.UICommand.broadcast(UICommand.java:109)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.processAction(MyFacesGenericPortlet.java:246)
... 38 more
Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{databaseHandler.InsertApplicant}
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
... 45 more
[ July 07, 2008: Message edited by: Omar Barrera ]
13 years ago
JSF
Hello All,

I am new to JSF and am having an issue with a selectonemenu component always being null. I have form that is is populated with backing bean list that has the states. On the form the list displays properly. However when I attempt to write the value to the database, I get a null value.


Backing bean with list:



jsp view page:


selectedState method:
13 years ago
JSF
Thanks for the tip. And I will be sure to follow your posting recommendation.
13 years ago
I have been able to narrow down my problem even further. The problem lies with the following statement:



The error I am getting from tomcat is java.lang.ClassCastExeption: org.apache.pluto.core.impl.PortletContextImpl
13 years ago
Hello All,

I have another question regarding the jsf portlet I am working on. I can not get my database utility class to work. I added the actionListener tag to command component, added a web listener value to the web.xml and created three related classes, a DatabaseUtil class, an ApplicationContextListener, and ActionListener Class. If you have seen the code below it is becuase I modeled my code after this example. I have been able to trace my problem to the statement that calls the insert a record statement bolded below. The error I receive is java.lang.classcastexception. I don't even make it into the method.



[ June 17, 2008: Message edited by: Omar Barrera ]
13 years ago
Will do. Thanks for your time and prompt response.
13 years ago
Well after careful scrutiny of my web.xml file I discovered that I had a listener context that was throwing the behavior of the portlet off. Upwards and onwards.

[ June 12, 2008: Message edited by: Omar Barrera ]
13 years ago
Thanks for the prompt response and information. I stumbled across your website via google last week and now your responding to my post, very cool. Great web site btw!!
13 years ago
Hello All,

It has been a while since I posted to the ranch, but now that I am in development mode and I have some questions. Please forgive me for asking what may be trivial questions but I am complete newbie to all of these technologies. First of all my environment is Uportal 2.5.3, Java 5 and Tomcat 5.5 and JSR 168. I am also using the Apache foundations implementation of JSF, Myfaces 1.5. Couple of questions, when I deploy my portlet to Tomcat the navigation works correctly, however when I put my portlet into uPortal the application just refreshes to the same page. Strange. Also I created a Databaseutil class to update a database. This class implements the ActionListener. My supervisor told me that the way I wrote that class was the old way of writing to a database. He said the new JSF way was to put the database calls in the javabeans. Any ideas on what he was referring to? javascript: x()
Confused
13 years ago
Thank you for replying promptly.

Omar
16 years ago
Hello all,

I have been attempting to use the javaranch.common package that I installed with an application that I am writing in java. I am fairly new to java and am having some transitional problems. Essentially my program will retrieve some files via ftp and rename and append the run date to the file name. I decided to use the com.javaranch package because it seemed like it has lot of the funtionality that I need. Anyway...here is a segment of my code that retreives the files and then will rename the file with the date appended to the file name. I am stuck...any pointers are greatly appreciated. Basically I need help with calling the rename function, using the convertDateToString method. Am using the imported methhods properly? I placed question marks in the area that I am stuck in. Thank You.
.
.
.

//Create new file objects
File clmDisb = new File("c:/clm_disb.clm");
File clmPay = new File("c:/clm_pay.lbx");

Date today = new Date();

???clmDisb.rename("c:/clm_disb" + convertDateToSTring(today)???);


//method to return date
public static String convertDateToString(Date today){
Calendar cal = Calendar.getInstance();
cal.setTime(today);
return "_"
+ (cal.get(Calendar.MONTH)+1)
+ (cal.get(Calendar.DATE)-1)
+ cal.get(Calendar.YEAR);
}
.
.
16 years ago