biswajit goswami

Ranch Hand
+ Follow
since Dec 05, 2005
Merit badge: grant badges
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 biswajit goswami

its resolved.There's .state file in config folder of eclipse.Seems it got corrupted.(Reason:may be improper shutdown)So i replaced that entire config folder from my colleague ,and now rad is happy.
when using assertextintable("tableid","text") it says table not found although its visible in the view source.this table is inside another table and jwebunit recognises that outer table.Any clue??
17 years ago
Working on RAD.Suddenly,its not getting started.Throws a message to see the log files of eclipse,and here it is:


!SESSION Jul 03, 2006 10:22:24.594 ---------------------------------------------
eclipse.buildId=I200406192000
java.fullversion=J2RE 1.4.2 IBM J9 2.2 Windows XP x86-32 j9n142ifx-20041102 (JIT enabled)
J9VM - 20040916_0908_lHdSMR
JIT - r7_level20040915_1801
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -plugincustomization C:\Program Files\IBM\Rational\SDP\6.0\eclipse\default\plugin_customization.ini

!ENTRY org.eclipse.osgi Jul 03, 2006 10:22:24.594
!MESSAGE Startup error
!STACK 1
java.lang.NullPointerException
at org.eclipse.core.runtime.adaptor.EclipseBundleData.generateManifest(EclipseBundleData.java:233)
at org.eclipse.core.runtime.adaptor.EclipseBundleData.loadManifest(EclipseBundleData.java:191)
at org.eclipse.core.runtime.adaptor.CachedManifest.getManifest(CachedManifest.java:36)
at org.eclipse.core.runtime.adaptor.CachedManifest.get(CachedManifest.java:75)
at org.eclipse.osgi.internal.resolver.StateBuilder.createBundleDescription(StateBuilder.java:38)
at org.eclipse.osgi.internal.resolver.StateObjectFactoryImpl.createBundleDescription(StateObjectFactoryImpl.java:29)
at org.eclipse.core.runtime.adaptor.EclipseAdaptor.createStateManager(EclipseAdaptor.java:144)
at org.eclipse.osgi.framework.internal.defaultadaptor.DefaultAdaptor.initialize(DefaultAdaptor.java:127)
at org.eclipse.core.runtime.adaptor.EclipseAdaptor.initialize(EclipseAdaptor.java:92)
at org.eclipse.osgi.framework.internal.core.Framework.initialize(Framework.java:113)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:95)
at org.eclipse.osgi.framework.internal.core.OSGi.createFramework(OSGi.java:90)
at org.eclipse.osgi.framework.internal.core.OSGi.<init>(OSGi.java:31)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:215)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at org.eclipse.core.launcher.Main.main(Main.java:688)
!SESSION Mon Jul 03 10:22:24 IST 2006 ------------------------------------------
!ENTRY org.eclipse.core.launcher 4 0 Jul 03, 2006 10:22:24.610
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.NullPointerException
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at org.eclipse.core.launcher.Main.main(Main.java:688)
It seems like an error with eclipse.Any help appreciated.
that part was already done......sorted resultset populates the map
17 years ago
its solved..........use
HashMap map=new LinkedHashMap();
17 years ago
hi,
A hashmap is a form attribute(say mapObject) and contains two key value pairs,say{(a,0),(b,0)}.....sorted
i am displaying the key in jsp by:
<logic:iterate id="map" name="myForm" property="mapObject">
<bean:write name="map" property="key"/>
</logic:iterate>


o/p:
b
a

ok,modify the map.........{(a,0),(b,0),(c,0)}

o/p:
b
c
a


its seems that the key is picked from the map randomly,although its sorted there.

can anyone throw light??
17 years ago
thanks.........
17 years ago
a byte array needs to be zipped and returned, without making use of intermediate temporary file.......i am able to zip as follows:


ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName.toString()));
FileInputStream fileStream = new FileInputStream(newFile);
out.putNextEntry(new ZipEntry(zipFileName.toString()));
int len;
while((len = fileStream.read(buf)) > 0) {
out.write(buf, 0, len);
}
out.closeEntry();
fileStream.close();

out.close();
then read the zipped file

in doing so i am first making a zipped file and then reading that file to retrieve the zipped byte array.i dont want this intermediate file to be created and still be able to get the byte array.Any help welcome
17 years ago
i would like to elaborate the situation:
the dialog box promts for the three options:
save---saves in system and then u open it from system,then all the file contents displayed
but open from the dialog box then the file is opened but with no content
i am unable to figure out whats wrong.........i am not using any session variables or cookies
17 years ago
functionality retrieves file from dbase using hibernate and dialog box appears promting user to open save or cancel...........now the problem:
save it in the system and open the file .....its fine,all the contents of the file are displayed
BUT open the file straight from the dialog box then the appropriate application is triggered but the file is empty...eg if its a txt file then notepad opens it but there is nothing displayed.Here's the code in the action class:
public ActionForward downloadById(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
String fileId=request.getParameter(FILE_ID);
ServiceFactory factory=ServiceFactory.getServiceFactory();
FileBusinessService fileService=(FileBusinessService)factory.getService(FileBusinessService.class);
File file=fileService.retrieveFile(fileId);
String fileName=file.getName();
byte[] fileArray=file.getContent();
String fileType = fileName.substring(fileName.indexOf(".")+1,fileName.length());
setContentTypeHelper(response,fileType,fileName);//see down

ServletOutputStream outStream = response.getOutputStream();
outStream.write(fileArray);
outStream.flush();
outStream.close();

return mapping.findForward("find");

}

private void setContentTypeHelper(HttpServletResponse response,String fileType,String fileName){
if (fileType.trim().equalsIgnoreCase("txt")){
response.setContentType( "text/plain" );
}else if (fileType.trim().equalsIgnoreCase("doc")){
response.setContentType( "application/msword" );
}else if (fileType.trim().equalsIgnoreCase("xls")){
response.setContentType( "application/vnd.ms-excel" );
}else if (fileType.trim().equalsIgnoreCase("pdf")){
response.setContentType( "application/pdf" );
}else if (fileType.trim().equalsIgnoreCase("ppt")){
response.setContentType( "application/ppt" );
}else{
response.setContentType( "application/octet-stream" );
}
response.setHeader("Content-Disposition","attachment; filename=\""+fileName+"\"");
response.setHeader("cache-control", "no-cache");

}
ANY IDEA??
17 years ago
functionality retrieves file from dbase using hibernate and dialog box appears promting user to open save or cancel...........now the problem:
save it in the system and open the file .....its fine
BUT open the file straight from the dialog box then the appropriate application is triggered but the file is empty...eg if its a txt file then notepad opens it but there is nothing displayed.Here's the code in the action class:
public ActionForward downloadById(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
String fileId=request.getParameter(FILE_ID);
ServiceFactory factory=ServiceFactory.getServiceFactory();
FileBusinessService fileService=(FileBusinessService)factory.getService(FileBusinessService.class);
File file=fileService.retrieveFile(fileId);
String fileName=file.getName();
byte[] fileArray=file.getContent();
String fileType = fileName.substring(fileName.indexOf(".")+1,fileName.length());
setContentTypeHelper(response,fileType,fileName);//see down

ServletOutputStream outStream = response.getOutputStream();
outStream.write(fileArray);
outStream.flush();
outStream.close();

return mapping.findForward("find");

}

private void setContentTypeHelper(HttpServletResponse response,String fileType,String fileName){
if (fileType.trim().equalsIgnoreCase("txt")){
response.setContentType( "text/plain" );
}else if (fileType.trim().equalsIgnoreCase("doc")){
response.setContentType( "application/msword" );
}else if (fileType.trim().equalsIgnoreCase("xls")){
response.setContentType( "application/vnd.ms-excel" );
}else if (fileType.trim().equalsIgnoreCase("pdf")){
response.setContentType( "application/pdf" );
}else if (fileType.trim().equalsIgnoreCase("ppt")){
response.setContentType( "application/ppt" );
}else{
response.setContentType( "application/octet-stream" );
}
response.setHeader("Content-Disposition","attachment; filename=\""+fileName+"\"");
response.setHeader("cache-control", "no-cache");

}
ANY IDEA??
[ May 05, 2006: Message edited by: Bear Bibeault ]
17 years ago
functionality retrieves file from dbase using hibernate and dialog box appears promting user to open save or cancel...........now the problem:
save it in the system and open the file .....its fine
BUT open the file straight from the dialog box then the appropriate application is triggered but the file is empty...eg if its a txt file then notepad opens it but there is nothing displayed.Here's the code in the action class:
public ActionForward downloadById(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
String fileId=request.getParameter(FILE_ID);
ServiceFactory factory=ServiceFactory.getServiceFactory();
FileBusinessService fileService=(FileBusinessService)factory.getService(FileBusinessService.class);
File file=fileService.retrieveFile(fileId);
String fileName=file.getName();
byte[] fileArray=file.getContent();
String fileType = fileName.substring(fileName.indexOf(".")+1,fileName.length());
setContentTypeHelper(response,fileType,fileName);//see down

ServletOutputStream outStream = response.getOutputStream();
outStream.write(fileArray);
outStream.flush();
outStream.close();

return mapping.findForward("find");

}

private void setContentTypeHelper(HttpServletResponse response,String fileType,String fileName){
if (fileType.trim().equalsIgnoreCase("txt")){
response.setContentType( "text/plain" );
}else if (fileType.trim().equalsIgnoreCase("doc")){
response.setContentType( "application/msword" );
}else if (fileType.trim().equalsIgnoreCase("xls")){
response.setContentType( "application/vnd.ms-excel" );
}else if (fileType.trim().equalsIgnoreCase("pdf")){
response.setContentType( "application/pdf" );
}else if (fileType.trim().equalsIgnoreCase("ppt")){
response.setContentType( "application/ppt" );
}else{
response.setContentType( "application/octet-stream" );
}
response.setHeader("Content-Disposition","attachment; filename=\""+fileName+"\"");
response.setHeader("cache-control", "no-cache");

}
ANY IDEA??
17 years ago
hi Anselm,which java technologies did u use??j2ee/j2se,struts,ejb........and which telecom domain concepts did u really require
17 years ago
Where can i find the source codes of the examples in the book "Pure javascript" by "Allen Wyke,Gilliam,Ting"??thanks
Thanx for the replies.....so,does windows media plyr and sorts using flat files as database??may be.........i shall be glad if somebody could illustrate using flat files and xml files to perform database operations(i have so long done with database servers basically).........the goal is to have a standalone database intensive app which can be run anywhere by its executable jar .Any good link,code snippets,book??thanx in advance
18 years ago