robbie keane

Ranch Hand
+ Follow
since Sep 05, 2005
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 robbie keane

I have written a single table EJB 3 code and it works perfectly fine with the basic CRUD operations. Now i want to enhance this code by calling Stored procedures but I'm not too sure how to go about it. I used Eclipse ganymede as IDE and use 'JPA Tools' plugin to create the Entities. Since my Stored Proc has sqls that are join of 5 or more tables (each having around 10 columns), how do i generate an entity for it (the returned result set). Is native call the only way for making calls (a conventioanl way) and no way EJB 3 supprt it? Can you direct me to some useful url which has some code examples of accomplishing this?


Thanks in advance.

Cheers.
Robbie
A daft question - do we have to submit a working application (someone spoke about jars here) or just the diagrams as mentioned on Sun site (http://www.sun.com/training/catalog/courses/CX-310-301A.xml) i.e.

Your project will be evaluated on a large number of objective criteria that fall into five sections:

1) Class Diagram: This section covers how well your class diagram(s) address the object model needed to satisfy the requirements.

2) Component Diagram: This section covers how well your component diagram(s) convey the structure of the architecture in satisfying the requirements.

3) Deployment Diagram: This section covers how well your deployment diagram conveys the production environment in satisfying the requirements.

4) Sequence/Collaboration Diagrams: This section covers how well your sequence or collaboration diagrams satisfy the requirements of the assignment.

5) Risk and Mitigation List: This section covers how well you have identified and mitigated risks that are involved in architecting the solution.

Additionally, categories 1-4 are evaluated on UML compliance.

Thanks
Congrats Pav. The site for the Pete's notes doesn't seem to exist any longer (http://www.sarahandpete.com/). Can you upload them to some other site for the group's reference.


Thanks.
Robbie
Thanks a lot Chern. That has worked.
16 years ago
Greetings,
I would like to know if I'm calling a target say deploy and it fails (that is error message comes that build has failed), I would like to detect this message and call some target on failure.
I can record that in a log file using debuglevel="error" but not able to call a different target on it.
Thanks in anticipation
16 years ago
Hi,
How can i loop through a build.properties file and do selective inclusion of jars. I don't want to include filesset as <fileset dir="${lib.dir}" includes="**/*.jar"/> and also I don't want to modify my build.xml.

I just want to change the build.properties and say by comma or semi-comma separating a property abc=aa.jar;bb.jar;zz.jar , I can include these jars.


Thanks in anticipation.
Robbie
16 years ago
Thanks Ernest.
It's working and finding the entire line but now how do i look for each of the directories and sub - directories for the file.
Here's my code:
import java.io.*;

public class Test {

public static void main(String[] args) {
try{
// here specify the directory name
File directory = new File("C:\\Temp\\New Folder");

BufferedWriter out = new BufferedWriter(new FileWriter("outfilename.txt"));;
File[] files = directory.listFiles();

for (int i = 0; i < files.length; i++) {
count(files[i],out);
}
out.close();
}catch (Exception e){
e.printStackTrace();
}
}
private static void count(File fileName, BufferedWriter out) {
BufferedReader in = null;
try {
FileReader fileReader = new FileReader(fileName);
in = new BufferedReader(fileReader);
count(in,out);
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
}

private static void count(BufferedReader in, BufferedWriter out) throws
IOException {
String line;
try{
do {
line = in.readLine();
if (line != null)
{
ifWordsExists(line,out); // if word exist then write whole line to a new file
}
}
while (line != null);
} catch(Exception e){
e.printStackTrace();
}
}

private static void ifWordsExists(String line,BufferedWriter out) throws IOException{
StringBuffer bf = null;
int index = 0;
while (index < line.length()) {
if(bf == null)
bf = new StringBuffer();
char c = line.charAt(index++);
boolean whitespace = Character.isWhitespace(c);
if (!whitespace) {
bf.append(c);
}else{
if("test".equalsIgnoreCase(bf.toString())){
try {
out.write(line);
out.write("\r\n");
} catch (IOException e) {
e.printStackTrace();
}
bf = null;
break;
}else{
bf = null;
}
}
}
if(bf != null && "test".equalsIgnoreCase(bf.toString())){
out.write(line);
out.write("\r\n");
}
}

}


thanks in advance
16 years ago
Thanks but i'm still not able to get that to work. Can you send some sample code for me as a starting point. I need to print the entire line after i've found the text.

Thanks in anticipation.
16 years ago
will indexOf work for exact string (case sensitive) , I want the code to look for string in file and the searched string should be case insenstive.

Regards.
16 years ago
Thanks Rahul.
How should I PROCEED with the line? can you please send some sample code.

Appreciated.
Robbie
16 years ago
Hi,
I need to find a string in a file in such that if the string is present, I need to print the entire line after that (end of line). How do i find all occurences in a file (indexOf, substring all work for one string).
e.g. if i need to fing string 'test' in a file that has foll content:
****file start****
this is a test for string
here we will check for
a test string in a file
and if we find it
we need to print the
entire test strings.
****file end****

should return me:
test for string
test string in a file
test strings.

Pls suggest if I can find some sample code for this.

Regards
Robbie
16 years ago
Thanks. I tried indexed properties.
I used the foll code but if i try reading the form fields in next action, i get null value.

my form snippet looks like:
public String[] getAddressTelephone() {
return addressTelephone;
}

public void setAddressTelephone(String[] addressTelephone) {
System.out.println("#####addressTelephone###");
this.addressTelephone = addressTelephone;
}

my jsp has:
<c:forEach var="addcity" items="${editProfileForm.addressCity}">
<tr>
<td valign="middle"><strong><font color="ff0000">*</font> City: </strong></td>
<td valign="middle">
<html:text property="addressCity" name="editProfileForm" value="${addcity}"/>
</td>
</tr>

<BR/>
</c:forEach>

and in my action:
String[] addCity =
editProfileForm.getAddressCity();
if(addCity!=null){
for(int i=0;i<addCity.length;i++){
System.out.println("####$$$$$addCity\n" +
addCity[i]);
}
}
This addCity is always null.


VIEW source of html looks like:
<tr>
<td valign="middle"><strong><font color="ff0000">*</font> City: </strong></td>
<td valign="middle">
<input type="text" name="org.apache.struts.taglib.html.BEAN[0].addressCity" value="abcdZZ">
</td>
</tr>

pls help.

Thanks in anticipation.
Robbie
17 years ago
Hi,
In my project I'm using struts. I have a requirement that in my jsp page, I need to create a link by clicking which few text boxes will be generated. So if I click this link say 5 times, it should give 5 set of text boxes. Now I need to read these text fields in my Action class. Now how do I define these dynamic fields my form class (some array, list etc) and use them in action?

regards
Robbie
17 years ago
hi,
Say i have a page which has many portlets. If the user minimises few of the portlets and goes to some other page, then return to this same page, his preferences are retained. Now if the user logs off and logs in again, all the preferences are lost. Is there a way I can save user preferences (which portlets are minimized and which are maximised) somewhere?

cheers
robbie
17 years ago
Hi,
I'm new to RIA, can you please suggest if there is similar forum for RIA.
One the face of it, this tech looks very promising / impressive. All you geeks out there, I would like to know your comments on RIA (especially Adobe Flex).

regards
Robbie