Dario Sarcevic

Greenhorn
+ Follow
since Mar 10, 2012
Merit badge: grant badges
For More
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 Dario Sarcevic

Hello!

I am new to JSF and I found something what I dont understand well. I would be very thankful if some could explain me what is difference between updated and rendered?

Thanks in advance.

Dario
11 years ago
JSF
Thank you very much Tim, not only on reply on my post but also for sharing your knowledge. I solved my problem with adding roles on glassfish realm and mapped in web.xml.

Components are using rendered="#{facesContext.externalContext.isUserInRole('ROLE_NAME')}" and its working like a charm, thank you very much!
11 years ago
JSF
Hello all!

My truly apologies if topic somewhere exists -I couldn't find topic with "problem" like mine. I developed J2EE application and now I am trying to implement security measures. In my project I am using JSF 2.0 , EJB 3.0 and JPA. After Login page (JAAS used) next page is Index.xhtml and index has menu- links to other pages (Emloyees,Vehicles,Payment, etc) . Now, I wanna implement Roles (Admin and User). AdMIN see (has access) to all menu items and can use it and USER see only some specific commandLink (Vehicles eg). How to do that? Is it possible to configure with some filter or can be done on glassfish?

Thanks in advance, any information is welcome!
11 years ago
JSF
Problem solved by:

Hello everyone, I am fresh in java world and I stucked with searching database. So, my application is connected to msacces and my Jframe has jtable and some textfield's. I have one textfield which is called Searchfield and when I press some number in that field its searching database and if i pressed 5 its showing student with ID 5. My problem is next, I created button which random generating numbers (1-34) and writing them into Searchfield, but when Searchfield gets that random generated number nothing happening. Thanks in advance for reading this.

This is part of code for searching by ID:

private void txtsearchKeyReleased(java.awt.event.KeyEvent evt) {
//search by ID
String temp = txtsearch.getText() + "%";
String sql = "select * from table1 where ID like'"+temp+"'";
try{
pst = conn.prepareStatement(sql);
rs = pst.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}
catch (Exception e){
JOptionPane.showMessageDialog(null, e);
}
}

That works just like it should , but i dont know how to set this:
private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {
// random number 1-34


Random randomnumb = new Random();
int number = 1 + randomnumb.nextInt(34);
txtsearch.setText(String.valueOf(number));

Its only show number in searchfield, nothing else (not searching DB)