G.T. Reddy

Ranch Hand
+ Follow
since Jun 25, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by G.T. Reddy

Yes Eric. I am using IE only still I am not understanding your comment "low security levels".Could you please elaborate it and I would appreciate if you provide me the solution. Thanks
Hi All,
I have a problem while submitting the form through tab navigation.

in a form I have browse button(created using <input type="file"> tag) but this is hidden by a customized browse button as shown in the following code.

<form id="uploadform" name ="uploadform" method="post" enctype="multipart/form-data" action="<e:txDir />/SaveImageEvent"
target="logo_upload">

<input type="file" class="hide" id="datafileLogo" name="datafileLogo"
onChange="javascript:saveImage('repLogo','datafileLogo','logo_upload');"/>
<a href="javascript:repReportOptions.openFileWindow('datafileLogo')" id="likfileLogo"><img src="/browse_btn.gif" border="disabled"/></a>
</form>

//this method is used to open the file selection window on clicking the image above Browse image.
this.openFileWindow = function(objectId)
{
var flvar = document.getElementById(objectId);
flvar.click();
}


//this save image method is called when the user selects the image from the file window( on onChange) .Here I have to use the TAB navigation only to select and submit the selected file.
this.saveImage = function(imagePrefix,imageName,displayImageFrame)
{
var fileName = document.getElementById(imageName).value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
var thefile = fileSystem.getFile(fileName);
var size = thefile.size;

if(((fileType == ".gif") || (fileType == ".GIF")) && (size <= 1048576))
{
document.uploadform.imageType.value = fileType;
document.uploadform.imagePrefix.value = imagePrefix;
document.uploadform.fileOperation.value= 'saveImage';
document.uploadform.target = displayImageFrame;
document.uploadform.imagefileName.value = imageName;
document.uploadform.submit();
}
else
{
util.alert("Images must be .gif files less than 1MB is size. Click the information icon in the coverpage options section for more information.");
}

}
14 years ago
JSP
Hi All,
I have a problem while submitting the form through tab navigation.

in a form I have browse button(created using <input type="file"> tag) but this is hidden by a customized browse button as shown in the following code.

<form id="uploadform" name ="uploadform" method="post" enctype="multipart/form-data" action="<e:txDir />/SaveImageEvent"
target="logo_upload">

<input type="file" class="hide" id="datafileLogo" name="datafileLogo"
onChange="javascript:saveImage('repLogo','datafileLogo','logo_upload');"/>
<a href="javascript:repReportOptions.openFileWindow('datafileLogo')" id="likfileLogo"><img src="/browse_btn.gif" border="disabled"/></a>
</form>

//this method is used to open the file selection window on clicking the image above Browse image.
this.openFileWindow = function(objectId)
{
var flvar = document.getElementById(objectId);
flvar.click();
}


//this save image method is called when the user selects the image from the file window( on onChange) .Here I have to use the TAB navigation only to select and submit the selected file.
this.saveImage = function(imagePrefix,imageName,displayImageFrame)
{
var fileName = document.getElementById(imageName).value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
var thefile = fileSystem.getFile(fileName);
var size = thefile.size;

if(((fileType == ".gif") || (fileType == ".GIF")) && (size <= 1048576))
{
document.uploadform.imageType.value = fileType;
document.uploadform.imagePrefix.value = imagePrefix;
document.uploadform.fileOperation.value= 'saveImage';
document.uploadform.target = displayImageFrame;
document.uploadform.imagefileName.value = imageName;
document.uploadform.submit();
}
else
{
util.alert("Images must be .gif files less than 1MB is size. Click the information icon in the coverpage options section for more information.");
}

}


Here the problem is document.uploadform.submit(); line is not executing in the above saveImage () method(when I use TAB for selecting and submit the selected file from the file window) and all statements above the document.uploadform.submit() statement are executing properly.

When I use Mouse everything is working file. Please suggest a solution as this is killing me for the past 3 days.


Problem solved, it was a driver mismatch between server and client.


could you please elaborate the above solution.

Thanks,
Reddy
You can use WINRAR
15 years ago
Hi Rajah,
If U don't mind Could U please send me the code.
I am working in US and I had very busy schedule.

Thanks & regards,
GTR
18 years ago
Hi All,
I have been facing one problem in fetching windows(client) login user id in struts application.

The requirement is like this:
------------------------------
When the user(on some other windows m/c ) connecting to application through IE browser which is running in weblogic server,I need to get the
that user windows login id in java/jsp class.
please help me.

Thanks,
GTR
18 years ago
Hi,
I am facing the one problem while displaying dynamic image along with other content.
I am able to create the image from the blob but I don�t know where to keep this image in the server or else where so that I can give the link in JSP to this image path. In the jsp page along with this image I need to display some report. If image is the only one to display I can do it. But I am not able to display along with some other content.
Please help If some body knows the solution.

Regards,
GTR
18 years ago
//server side
public ArrayList getPressSystems(){
ArrayList pressSystems = new ArrayList();
Connection con = DatabaseHelper.prepareConnection();
String query = SDCQueries.SELECT_REF_PART_PRESS_SYSTEMS;
psmt = con.prepareStatement(query);
rs = psmt.executeQuery();
while (rs.next()) {
pressSystems.add(new LabelValueBean(rs.getString(1), rs.getString(1)));

}
return pressSystems;

}

////in action class
ArrayList pressSystems =(ArrayList) searchBo.getPressSystems(estimateId);

form.setPressSystems(pressSystems);

return mapping.findForward(jsppage);

//in jsp page

<html:select name="form" property="pressSystem" size="1">
<html ptions collection = "pressSystems" property = "value" labelproperty = "label"/>
</html:select>
19 years ago
document.formname.filetagname.value
19 years ago
document.[formName[.[filetag name].value
19 years ago
Hi All,

I have been facing one problem in reading an embadded image from excel sheet and loading that image into the oracle database as a blob . When I am reading this image using jxl (API as shown below code) some junk value is read into the database.So if any body has some suggestions just help me out..

I�m writing the code which I am using. and I�m not able to attach the the excel as it is very big but just to let u know it uses EMBED("MSPhotoEd.3","") in the formula bar of excel sheet to embed image in the excel sheet. Here i don't know the image type also.

code:
-----

import jxl.Cell;
import jxl.Image;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;

// reading the drawing

Workbook workbook = Workbook.getWorkbook("excelfilename");
Sheet sheet = workbook.getSheet("CUSTOMER");
Image img = sheet.getDrawing(0);

// putting it in byte array
byte[] imageData = img.getImageData();

System.out.println("byty array length : "+imageData.length);// it is giving some valid value

// inserting into database blob object

prepareStatement.setBytes(1, imageData);

while loading these bytes into database (as blob) it is not giving any error and loading properly I assume. After loading I am trying to fetch this blob and creating jpg image.while displaying it is not displaying that image.


//this is one more way of loading byte array into database.still we are not able to display the image in the browser.

public int loadImage(InputStream byte[] imageBytes, String estimateId, int length)
throws ApplicationException, FatalException {

sdcLogger.logDebugMessage("Start of loadImageTest method");
PreparedStatement pstmt = null;
Connection con = null;
ResultSet blobRs = null;
int returnValue = 1;
java.sql.Blob blob = null;
Statement stmt;
OutputStream outStream;
try {
sdcLogger.logDebugMessage("estimateId :" + estimateId);
sdcLogger.logDebugMessage("length :" + length);
con = DatabaseHelper.prepareConnection();
con.setAutoCommit(false);
pstmt = con.prepareStatement(SDCQueries.UPDATE_EMPTY_BLOB);
pstmt.setString(1, estimateId);
pstmt.executeUpdate();
stmt = con.createStatement();
blobRs =
stmt.executeQuery(
"Select part_image from Estimate "
+ "where estimate_id ="
+ estimateId
+ " for update");
blobRs.next();
blob = blobRs.getBlob(1);
outStream =((OracleBlob) blob).getBinaryOutputStream();
outStream.write(imageBytes);
/*
//byte[] chunk = new byte[fis.available()];
//int i = -1;
//while ((i = fis.read(chunk)) != -1) {
// outStream.write(chunk, 0, i);
// }
*/
//Close the input and output stream.
fis.close();
outStream.close();
con.commit();
sdcLogger.logDebugMessage("**********************************");
sdcLogger.logDebugMessage("image uploaded successfully");
sdcLogger.logDebugMessage("************************************");

} catch (SQLException sqlException) {
sdcLogger.logError(
"An error occured in search method of RefPartSearchDAO",
"getEstimateHistory method",
sqlException);
returnValue = -1;

} catch (Exception exception) {
sdcLogger.logError(
"Fatal Exception occured",
"getEstimateHistory method",
exception);
returnValue = -1;
} finally {
try {
if (blobRs != null) {
blobRs.close();
}

if (pstmt != null) {
pstmt.close();
}
if (pstmt != null) {
pstmt.close();
}
if (con != null) {
con.close();
}
} catch (SQLException sqlException) {

sdcLogger.logError(
"An error occured in search method of RefPartSearchDAO",
"getEstimateHistory method",
sqlException);
} catch (Exception exception) {
sdcLogger.logError(
"Fatal Exception occured",
"getEstimateHistory method",
exception);
}
} //finally

return returnValue;
} //end of loadimage


if any body can come with some suggestions about how can i do it.It will be quite helpful fro me.

Thanks,
GTR
19 years ago
Hi All,

We have web J2EE web based application which is deployed on weblogic
8.1 as an ear.
This EAR contains some EJB's some jar files and a war file.
Hi All,
We have web J2EE web based application which is deployed on weblogic
8.1 as an ear.
This EAR contains some EJB's some jar files and a war file.

Now we want to display an image on the jsp after retreiving it from the
database.Image is stored in the database as a BLOB object.
Currently what is implemented is e.g as soon as user selects a product an
image file (.jpg) is generated from the BLOB
object (at some predefined location say C:\ImageFolder) and in jsp(HTML)
we display this image with with giving this path in
IMG src tag.

Is there any way where we can get rid of this absolute path(hard coded)
path and generate the image at a relative path and display
from there in our jsp or is there any other wat to achieve it.
19 years ago
Hi Friends,
I am working in a onganization and recently moved to new vertical/dept.In this vertical I am working on one web application(Customer Information system)which mainly handles GAS suppiler activities like billing informantion,customer info,gas products information and its distributors(LDCs)infomation.This application is developed using JSP and java script running on Apache-Tomcat.The design of this system is as follows:
JSP
Model class(simple model class contains database variables as
members)
DAO class which retrieves data from the database(oracle) and creates one Model class object for each record to send to JSP to display on the browser.
Here DAO class uses other supporting major class "DbConnectionPool.java" to maintain the connections with the Oracle database.Front-end validations will be taken care by javascript.This is the design overview of the existing system.
Now Project manager is asking to prepare to document explaining the limitations of the existing system and advantages of STRUTS Frame work over this existing sysem and we can send this document to the client to get the business.I have little expirience with the Struts frame work.
Here I am not able document the exact benifits of the Struts and how this Struts frame work will address the enterprise needs.
I am searching for the good resources.So If you find good resources please let me know.
Awaiting for your valuable info.
Thanks,
Reddy.
20 years ago
Hi Andrew,
I know the meaning and implemented by modififing the Data.java class.But I am not able to explain the reason for doing one instead of the other.But one thing is if we extend Data class then one more class would me included unnecessarily in the project and we can prevent it by just modifing the Data class itself.SO no need to extend the Data class.
Am I correct?.Is there any thing else.If so please explain.
Thanks,
--Reddy.