Tanveer Rameez

Ranch Hand
+ Follow
since Dec 11, 2000
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Tanveer Rameez

Originally posted by Jan Groth:

Is there any specific reason why your String has to be obtained through someMethod() instead of getSomeString()?



I want the value to be determined at runtime based on certain conditions. The value in the form bean property is set once but meanwhile certain conditions changes and so only the displayed value should change(while the property should remain same).
11 years ago
Hi,

I have a struts html tag:
<html:text name="myFormBean" property="myProperty" />
I want to call a method instead of the property, i.e I want something like this:
<html:text name="myFormBean" property="someMethod" />
the someMethod returns a string and has signature : public String someMethod().
How do I do it?
Also I would like to have a set method so that the value can be set though that method, rather than set directly into a property.The method can be public void someMethod(String s);
Is there anything like get-method and set-method attribute in the html:text to use?
Thanks in Advance
Tanveer
11 years ago
hi
Thanks for the reply. Yes, that is a good away. I found another way of doing it too:


The StringWriter is a Writer and getbuffer gives the data written to that writer.

cheers
Tanveer
12 years ago
Hi
I want to get the input stream/reader from an outputstream/writer.
I am using XSLT transformer to generate HTML from XML using a XSLT.
hereis the code:

How do I get th oputput of the transform method in a String? I am passing a StreamResult object which wraps a OutputStream. The StreamResult object also can wrap a Writer. Now how do I obtain the content of the OutputStream or Writer? I think i will need to use a InputStream or a Reader from which i can obtain the data as String by using read(..) method. Am i right? If that is so, how do I obtain the InputStream or a Reader from the OutputStream or Writer?
many thanks in advance
Tanveer
[ June 30, 2005: Message edited by: Tanveer Rameez ]
12 years ago
1. use a bufferedimage
2. take its graphics object and draw the freehand on that grahics (g.drawLine...)
3. use imageIO in java 1.4.2 to save it JPG format and you can load that image.
4. however if you want to save only the coordinates, then first collect the coordinates in a Vector orany collection class. then save the Vector maybe using serialization, or you can use a simple text file to save the coordinates. To load the image, you can read the coordinates from the file and draw the lines accordingly.
12 years ago
A container can hold be used to display an image. I would use a JPanel to display an image using its paint(Graphics method) or a JLabel putting the imate as its icon.
12 years ago
The EJB QL

can be used instead of LIKE.
but my second problem is to make the search case insensitive. how do I do that. I am using Oracle Application Server (oc4j).
thanks
Tanveer
I have a SQL query which finds all the rows having a column name where the value contains the word 'wimpey' in it irrespective of case.the SQL is :

I am writing a CMP entity bean where there is a finder method findName. the EJB QL and the xml in the ejb-jar.xml is:

The ?1 corresponds ot the parameter passed as String to the method. but ofcourse this EJB QL does not work as it seems EJB QL 2.0 does not support upper.
So I changed the query to

But again the deployment to the server complains that there is a problem with 'like'. Please note that the table has column 'name'
I am using Oracle Application server standalone OC4J. the error message is :
oracle.oc4j.admin.internal.DeployerException: Error initializing ejb-module; Exception Error translating EJBQL: Encountered "o . name LIKE ?1" at line 1, column 8.

I have two question:
1. How do I write a EJB QL which tries to find rows having the word passed a parameter in a partcilar column irrespective of case
2. what's wring with my EJB QL even after I remove the upper, i.e what's wring with this:

Please help me as i need to complete the entity bean ASAP.

thanks in advance.
Tanveer
many thanx. It worked.
[ May 04, 2005: Message edited by: Tanveer Rameez ]
12 years ago
Hi all,
I have a textbox mapped to a formBean property.the html output of my struts JSP for that textbox is :
<input type="text" name="builderDetails.forename">

The '.' in the field name is because builderDetails is a attribute of object type Builder which again has a attribute forename.
Now I need a use the value of that field in a javascript . in the javascript, I refer the value of that field as :

where MyForm is the name of the form (and also name of the FormBean) containing the field.
I get javascript error saying 'forename is null or not an object'. Its the 'builderDetails.forename' name that javascript fails to recognize. For other properties say simple 'forename', the javascript works fine.

My question is , How do I use javascript to access fields having names like 'builderDetails.forename' or others with a '.' in the field name?

Thanx
Tanveer

[ May 04, 2005: Message edited by: Tanveer Rameez ]
[ May 04, 2005: Message edited by: Tanveer Rameez ]
12 years ago
can anyone tell me if there is any UML diagrams(Class diagram, sequence diagram) for struts framework somewhere in the net? I need to design the class diagram,sequence diagram and since the Struts framework remians unchanged in whatever project I use it, I thought existing diagrams might help me in making my own.
12 years ago
You mean to say in what language is the java compiler written in?
probably C/C++.
[ March 15, 2005: Message edited by: Tanveer Rameez ]
12 years ago
NSIS is a good program through which one can not only create executables but also installers. I used it to make installers for my java program and wrap my executable jar file in a exe file. and its FREE!!!
check this 2 link:
http://nsis.sourceforge.net/Docs/Chapter1.html
http://www.nullsoft.com/free/nsis/makensis.htm

You will need to read how to write the scripts, but that's not so hard.
[ March 15, 2005: Message edited by: Tanveer Rameez ]
12 years ago
Lot of methods of the java.util.Date class has been decrepated. Check the apis for GregorianCalendar. It can be used instead of Date class.
12 years ago
Java beans are also Java classes, but they can be considered as reusable component, which by itself is not a complete program but are used in programs. Ideally,
1. they should have no-args constructor (so that they can be instantiated at runtime by say, Class.forName(..) )
2. They should have getter and setter methods to access their attributes
3. They support introspection if required. They can use the classes provided in java.beans package for that.
4. They can support bound and constraint properties.
5. They should support serialization if the state of the java bean needs to be persistance
An Ideal GUI Java Bean can be loaded in any IDE like JBuilder,Eclipse and used just like any Swing component. Infact java swing components are Java Beans.
[ February 15, 2005: Message edited by: Tanveer Rameez ]
12 years ago