Problem with file length in jsp it is working in IE, not working Firefox
Hi,
I'm upload a file from the browser. i'm calculating the length i'm not getting the length of the file.
The below shown code is working perfectly in IE and not working in Firefox.
FileUpload.html
<DOCTYPE>
<HTML>
<HEAD>
<TITLE>Retailmint Jobs - Registration Form</TITLE>
</HEAD>
<BODY>
<form>
<table>
<tr><td>Upload Resume :</td>
<td> <input>
</td>
</tr>
</table>
<input>
</p>
<p> </p>
</form>
</BODY>
</HTML>
FileUploadSubmit.jsp
<page>
<page>
<page>
<html>
<head><title>Retailmint- Submission</title></head>
<body>
<FileInputStream>
</body>
</html>
I find an error in firefox browser is not taking the fully qualified path
i.e: C:\Documents and Settings\Administrator\Desktop\if.doc
In firefox it is taking if.doc only.
please tell me the solution.
Regards
venkat
I agree with your words
sorry for the code pasting.
Here is the code:
FileUpload.html
<HTML>
<HEAD>
<TITLE>Retailmint Jobs - Registration Form</TITLE>
</HEAD>
<BODY>
<form name='subregiform' method="get" action ="FileuploadSubmit.jsp" >
<table width="566" border="0" cellspacing="0" cellpadding="0">
<tr><td width="197"align="right">Upload Resume</td>
<td width="369"> <input type="file" name="file" value ="" >
</td>
</tr>
</table>
<input type="submit" name="submit" value="Submit">
</form>
</BODY>
</HTML>
FileUploadSubmit.jsp
<%@ page import="java.text.*"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<html>
<head><title>Retailmint- Submission</title>
</head>
<body bgcolor="#e0e0e0">
<%
FileInputStream fis = new FileInputStream(request.getParameter("file"));
len = (int)file.length();
System.out.println("length"+len);
%>
</body>
</html>
And how to find the absolute path of a file in jsp or java
Edited by: venkat.k on Sep 17, 2007 10:12 PM
Similar Messages
-
Problem with file length in jsp it is working in IE, not workig Firefox
Hi,
I'm upload a file from the browser. i'm calculating the length i'm not getting the length of the file.
The below shown code is working perfectly in IE and not working in Firefox.
FileUpload.html
<DOCTYPE>
<HTML>
<HEAD>
<TITLE>Retailmint Jobs - Registration Form</TITLE>
</HEAD>
<BODY>
<form>
<table>
<tr><td>Upload Resume :</td>
<td> <input>
</td>
</tr>
</table>
<input>
</p>
<p> </p>
</form>
</BODY>
</HTML>
FileUploadSubmit.jsp
<page>
<page>
<page>
<html>
<head><title>Retailmint- Submission</title></head>
<body>
<FileInputStream>
</body>
</html>
I find an error in firefox browser is not taking the fully qualified path
i.e: C:\Documents and Settings\Administrator\Desktop\if.doc
In firefox it is taking if.doc only.
please tell me the solution.
Regards
venkatSorry for that
here is the code:
FileUpload.html
<HTML>
<HEAD>
<TITLE>Retailmint Jobs - Registration Form</TITLE>
<script language="Javascript" src="FileRead.js">
</script>
</HEAD>
<BODY>
<form name='subregiform' method="get" action ="FileuploadSubmit.jsp" >
<table width="566" border="0" cellspacing="0" cellpadding="0">
<tr><td width="197"align="right">Upload Resume :</td>
<td width="369"> <input type="file" name="file" value ="" onchange ="javascript:fopen('file');"><br>
</td>
</tr>
</table><br>
<input type="submit" name="submit" value="Submit">
</strong></p>
<p> </p>
</form>
</BODY>
</HTML>
FileUploadSubmit.jsp
<%@ page import="java.text.*"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<jsp:useBean id="DBase" class="dbconnection.DBconnection" scope="session" />
<html>
<head><title>Retailmint- Submission</title>
</head>
<body bgcolor="#e0e0e0">
<%
FileInputStream fis = new FileInputStream(request.getParameter("file"));
len = (int)file.length();
System.out.println("length"+len);
%>
</body>
</html>
And tell me How to find the absolute path of a file in JSP or JAVA? -
Problem with file length in jsp IE it is working Firefox it is not workig
Hi,
I'm upload a file from the browser. i'm calculating the length i'm not getting the length of the file.
The below shown code is working perfectly in IE and not working in Firefox.
FileUpload.html
<DOCTYPE>
<HTML>
<HEAD>
<TITLE>Retailmint Jobs - Registration Form</TITLE>
</HEAD>
<BODY>
<form>
<table>
<tr><td>Upload Resume :</td>
<td> <input>
</td>
</tr>
</table>
<input>
</p>
<p> </p>
</form>
</BODY>
</HTML>
FileUploadSubmit.jsp
<page>
<page>
<page>
<html>
<head><title>Retailmint- Submission</title></head>
<body>
<FileInputStream>
</body>
</html>
I find an error in firefox browser is not taking the fully qualified path
i.e: C:\Documents and Settings\Administrator\Desktop\if.doc
In firefox it is taking if.doc only.
please tell me the solution.
Regards
venkatSorry for that
here is the code:
FileUpload.html
<HTML>
<HEAD>
<TITLE>Retailmint Jobs - Registration Form</TITLE>
<script language="Javascript" src="FileRead.js">
</script>
</HEAD>
<BODY>
<form name='subregiform' method="get" action ="FileuploadSubmit.jsp" >
<table width="566" border="0" cellspacing="0" cellpadding="0">
<tr><td width="197"align="right">Upload Resume :</td>
<td width="369"> <input type="file" name="file" value ="" onchange ="javascript:fopen('file');"><br>
</td>
</tr>
</table><br>
<input type="submit" name="submit" value="Submit">
</strong></p>
<p> </p>
</form>
</BODY>
</HTML>
FileUploadSubmit.jsp
<%@ page import="java.text.*"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<jsp:useBean id="DBase" class="dbconnection.DBconnection" scope="session" />
<html>
<head><title>Retailmint- Submission</title>
</head>
<body bgcolor="#e0e0e0">
<%
FileInputStream fis = new FileInputStream(request.getParameter("file"));
len = (int)file.length();
System.out.println("length"+len);
%>
</body>
</html>
And tell me How to find the absolute path of a file in JSP or JAVA? -
i have a problem with my MacBook Pro is the almost of my app not working at all like a app store and terminal and other important apps please if u can help me as fast as you can cuz i don't wanna format it that's why am on Mac now not win ?
Abdussalam.A,
you mentioned that Terminal does not work at all for your MacBook Pro. What currently happens when you run Terminal? In what way does it not work? -
i have a problem with iphone 4s...is ringing but another sounds not working....please help me!!!
Hi pystyke,
Welcome to Apple Support Communities.
You may find these links helpful with troubleshooting the audio issue you're experiencing:
iPhone Assistant
http://www.apple.com/support/iphone/troubleshooting/
iPhone: Hardware troubleshooting
http://support.apple.com/kb/TS2802
Best,
Jeremy -
i have problem with my iphone 5 lock switch..as lock switch not working properly..and my iphone is not in warrenty.. so plz tell me what i do...
The iPhone 5 is less than a year old, so all of them should still be in warranty unless they have been jailbroken or physically damaged. If you have a hardware problem as you describe the only option is to get the phone replaced by Apple or repaired by a non-authorized shop. The Apple replacement will be free at any Apple store in the country where the phone was purchased. If Apple determines that the phone was physically damaged or jailbroken it will cost $229.
-
Problem with file download through JSP under WLS6.1 SP3
Hello,
We're in the process of trying to migrate from WLS 6.1 SP1 to SP3, and we're encountering
some difficulties with this migration.
I'm attaching a very simple JSP here - it's a snippet from a larger more dynamic
JSP, that I managed to narrow down to a pretty simple case which still doesn't
work.
This JSP opens a file residing at "c:\\BDELog.txt" (it's hardcoded - so change
it to any textual local file on your machine in order to test it), and writes
it to the output stream as a txt attachment.
This JSP works perfectly well on SP1, however, on SP3, it fails only during the
first hit. If you call this JSP again from the same browser window - it'll work.
Needless to say - this isn't an acceptable behavior for a website.
Hope you can help.
Appreciate any response.
Roy.
[download.jsp]SP4 indeed solved it.
Thanks again!
Roy.
"Eric Gross" <[email protected]> wrote:
As a follow-up, SP4 is now available.
Regards,
Eric
"Eric Gross" <[email protected]> wrote in message
news:3dd19974$[email protected]..
I would wait until SP4(I believe it may be coming out this week actually).
If you can't wait until then, please contact support for a 1-off patch.
Regards,
Eric
"Roy Abitbol" <[email protected]> wrote in message
news:3dd10ef1$[email protected]..
Many thanks !! (sigh of relief...)
Is there a way to work around this problem - for example - write
the
header explicitly
so that the problematic header will be overriden or simply get a
patch
from you
guys ?
Or do we have to wait for SP4 ?
Thanks again,
Roy.
"Eric Gross" <[email protected]> wrote:
This is a known issue and has been fixed.
The fix is in SP4. This has to do with a bug that IE has with respect
to a
header:
Cache-Control: no-cache="set-cookie"
We introduced that as the default header to be returned on all
responses.
As of SP4(due out very soon), the default behaviour will be notto send
this
header back with each response.
Regards,
Eric
"Roy Abitbol" <[email protected]> wrote in message
news:3dca7f19$[email protected]..
Hello,
We're in the process of trying to migrate from WLS 6.1 SP1 to
SP3,
and
we're encountering
some difficulties with this migration.
I'm attaching a very simple JSP here - it's a snippet from a largermore
dynamic
JSP, that I managed to narrow down to a pretty simple case which
still
doesn't
work.
This JSP opens a file residing at "c:\\BDELog.txt" (it's hardcoded- so
change
it to any textual local file on your machine in order to test
it),
and
writes
it to the output stream as a txt attachment.
This JSP works perfectly well on SP1, however, on SP3, it fails
only
during the
first hit. If you call this JSP again from the same browser window- it'll
work.
Needless to say - this isn't an acceptable behavior for a website.
Hope you can help.
Appreciate any response.
Roy. -
Problem with activation of Office 2010 Professional, 'help' web link does not work
I am having problems activating a copy of Office Professional 2010 purchased retail. I am being told that the product key is not valid, though I have re-entered it twice. I click on the 'more information' link but the page doesn't load: http://wwwppe.dns.microsoft.com/howtotell/geo/content.aspx?pg=geo_off&displaylang=en?ERR=0xc004c003&LCID=1033&MSG=4&PID=02257-210-6072776-49466&ErrorCode=0xc004c003
Please advise what I should do.
ThanksCould you please follow the instructions below, run the commands in green, and paste your output?
Open anelevated command prompt
a.The
path below is the default install path, so it may be different if you've customized your install
b.If
you’re using 32b Office on a 64b OS, you may need to run it from the “Program Files (x86)” folder
c.Start,
search for ‘cmd’, right click on the command prompt window and select “Run as administrator”
d.cscript
"%ProgramFiles%\Microsoft Office\Office14\ospp.vbs" /dstatusall
Trigger activation
a.Launching
an Office application will then prompt you for activation via the UI. Alternatively you can trigger it using this command:
b.cscript
"%ProgramFiles%\Microsoft Office\Office14\ospp.vbs" /act
Check the status
a.The
following command will show the licensing status. Alternatively in the Office UI you can view the status by clicking File, Help.
b.cscript
"%ProgramFiles%\Microsoft Office\Office14\ospp.vbs" /dstatusall
Ted Way [MSFT], Program Manager, Microsoft Office: Enterprise Licensing, Group Policy, and 64-bit Office -
Three times I used the 'repair' button but nothing changed.
Could we have that in English please!
Repair rebuilds the index for messages, but as I completely fail to understand your subject so I have nothing to go on other than the repair button does not fix your issue, what ever that is. -
I loaded a new app on my Iphone then tried the Mayhem app but still getting the blue screen. What to do?
Repair your QuickTime.
Control Panel >
Win7/Vista - Program n Features
WinXp - Add n Remove Programs
Highlight QuickTime, click CHANGE then REPAIR -
I am sad, I have days trying to use Airdrop, my friends can see me, but I can not see them. I turned on my Wi-Fi, Bluetooth and I selected the option "available for ALL".... and nothing. I can receive photos from my friends... mean It work for them. I just restarted the phone to the basics configuration but it does not work, my phone still does not recognize my contacts.
warranty will cover it. Did you try only by changing the power adapter or did you change both cable and power adapter?
if you did the latter, see this page: https://www.apple.com/support/iphone/repair/battery-power/
you'll be able to contact Apple Support from there. -
Problem with file access in other computer in jsp
I have problem with file accessing in other computer in jsp.
The follow code
File folder=new File("Z:"+File.separator+"sharefolder");//Z is a net share driver
File[] files=folder.listFiles();
System.out.println("test");
System.out.println("length="+files.length);
will throw exception at the second print.
but it works well in main funtion.
Is anybody know what is the problem.
JSP works on windows2003 server,tomcat 5.0.28 JDK1.4 net share folder on windows2000 serverno error code for this.But when I start tomcat I get the follow error.
java.lang.IllegalArgumentException: Document base Z:\ does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:138)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3910)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4138)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1567)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Jun 5, 2006 6:55:41 PM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
Jun 5, 2006 6:55:41 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Jun 5, 2006 6:55:41 PM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
Jun 5, 2006 6:55:41 PM org.apache.catalina.core.StandardContext start
SEVERE: Exception during cleanup after start failed
LifecycleException: Container StandardContext[msgstore] has not been started
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4466)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1567)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) -
Problem with file descriptors not released by JMF
Hi,
I have a problem with file descriptors not released by JMF. My application opens a video file, creates a DataSource and a DataProcessor and the video frames generated are transmitted using the RTP protocol. Once video transmission ends up, if we stop and close the DataProcessor associated to the DataSource, the file descriptor identifying the video file is not released (checkable through /proc/pid/fd). If we repeat this processing once and again, the process reaches the maximum number of file descriptors allowed by the operating system.
The same problem has been reproduced with JMF-2.1.1e-Linux in several environments:
- Red Hat 7.3, Fedora Core 4
- jdk1.5.0_04, j2re1.4.2, j2sdk1.4.2, Blackdown Java
This is part of the source code:
// video.avi with tracks audio(PCMU) and video(H263)
String url="video.avi";
if ((ml = new MediaLocator(url)) == null) {
Logger.log(ambito,refTrazas+"Cannot build media locator from: " + url);
try {
// Create a DataSource given the media locator.
Logger.log(ambito,refTrazas+"Creating JMF data source");
try
ds = Manager.createDataSource(ml);
catch (Exception e) {
Logger.log(ambito,refTrazas+"Cannot create DataSource from: " + ml);
return 1;
p = Manager.createProcessor(ds);
} catch (Exception e) {
Logger.log(ambito,refTrazas+"Failed to create a processor from the given url: " + e);
return 1;
} // end try-catch
p.addControllerListener(this);
Logger.log(ambito,refTrazas+"Configure Processor.");
// Put the Processor into configured state.
p.configure();
if (!waitForState(p.Configured))
Logger.log(ambito,refTrazas+"Failed to configure the processor.");
p.close();
p=null;
return 1;
Logger.log(ambito,refTrazas+"Configured Processor OK.");
// So I can use it as a player.
p.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.RAW_RTP));
// videoTrack: track control for the video track
DrawFrame draw= new DrawFrame(this);
// Instantiate and set the frame access codec to the data flow path.
try {
Codec codec[] = {
draw,
new com.sun.media.codec.video.colorspace.JavaRGBToYUV(),
new com.ibm.media.codec.video.h263.NativeEncoder()};
videoTrack.setCodecChain(codec);
} catch (UnsupportedPlugInException e) {
Logger.log(ambito,refTrazas+"The processor does not support effects.");
} // end try-catch CodecChain creation
p.realize();
if (!waitForState(p.Realized))
Logger.log(ambito,refTrazas+"Failed to realize the processor.");
return 1;
Logger.log(ambito,refTrazas+"realized processor OK.");
/* After realize processor: THESE LINES OF SOURCE CODE DOES NOT RELEASE ITS FILE DESCRIPTOR !!!!!
p.stop();
p.deallocate();
p.close();
return 0;
// It continues up to the end of the transmission, properly drawing each video frame and transmit them
Logger.log(ambito,refTrazas+" Create Transmit.");
try {
int result = createTransmitter();
} catch (Exception e) {
Logger.log(ambito,refTrazas+"Error Create Transmitter.");
return 1;
} // end try-catch transmitter
Logger.log(ambito,refTrazas+"Start Procesor.");
// Start the processor.
p.start();
return 0;
} // end of main code
* stop when event "EndOfMediaEvent"
public int stop () {
try {
/* THIS PIECE OF CODE AND VARIATIONS HAVE BEEN TESTED
AND THE FILE DESCRIPTOR IS NEVER RELEASED */
p.stop();
p.deallocate();
p.close();
p= null;
for (int i = 0; i < rtpMgrs.length; i++)
if (rtpMgrs==null) continue;
Logger.log(ambito, refTrazas + "removeTargets;");
rtpMgrs[i].removeTargets( "Session ended.");
rtpMgrs[i].dispose();
rtpMgrs[i]=null;
} catch (Exception e) {
Logger.log(ambito,refTrazas+"Error Stoping:"+e);
return 1;
return 0;
} // end of stop()
* Controller Listener.
public void controllerUpdate(ControllerEvent evt) {
Logger.log(ambito,refTrazas+"\nControllerEvent."+evt.toString());
if (evt instanceof ConfigureCompleteEvent ||
evt instanceof RealizeCompleteEvent ||
evt instanceof PrefetchCompleteEvent) {
synchronized (waitSync) {
stateTransitionOK = true;
waitSync.notifyAll();
} else if (evt instanceof ResourceUnavailableEvent) {
synchronized (waitSync) {
stateTransitionOK = false;
waitSync.notifyAll();
} else if (evt instanceof EndOfMediaEvent) {
Logger.log(ambito,refTrazas+"\nEvento EndOfMediaEvent.");
this.stop();
else if (evt instanceof ControllerClosedEvent)
Logger.log(ambito,refTrazas+"\nEvent ControllerClosedEvent");
close = true;
waitSync.notifyAll();
else if (evt instanceof StopByRequestEvent)
Logger.log(ambito,refTrazas+"\nEvent StopByRequestEvent");
stop =true;
waitSync.notifyAll();
Many thanks.Its a bug on H263, if you test it without h263 track or with other video codec, the release will be ok.
You can try to use a not-Sun h263 codec like the one from fobs or jffmpeg projects. -
Problem with File Uploading.
Hi,
I have one problem with File Upload component.
JSP
<ui:upload binding="#{NewProblem.fileUpload1}" columns="#{SessionBean1.uploadedFile}" id="fileUpload1" labelLevel="3"
style="left: 24px; top: 24px; position: absolute" validator="#{NewProblem.fileUpload1_validate}"/>
Java
UploadedFile uploadedFile = getSessionBean1().getUploadedFile();
Variable uploadedFile is NULL :(((((((((((
web.xml
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<filter>
<filter-name>UploadFilter</filter-name>
<filter-class>com.sun.web.ui.util.UploadFilter</filter-class>
<init-param>
<param-name>maxSize</param-name>
<param-value>10000000</param-value>
</init-param>
<init-param>
<param-name>sizeThreshold</param-name>
<param-value>10024</param-value>
</init-param>
</filter>
Thanks.check out the fileUpload article
Using the File Upload Component
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/file_upload.html -
NT security problems with file I/O
I have 2 problems with file I/O. When I read from a file I use the getAbsolutePath() method that is part of the File class to find what directory the files are currenlty. The problem is that the returned path says that the file is on the desktop no matter what directory the file really is in. The second problem is that I am unable to save files anywhere but the desktop. I must run the class files from the desktop too to get it to work.
I am using NT 4.0 for development. I'm guessing that these problems might be NT security related. Could someone help me?
Code below:
import java.awt.*;
import java.applet.*;
import java.net.*;
import java.io.File;
import java.awt.event.*;
//import java.security.*;
//import sun.security.*;
//import java.awt.Window;
//import com.ms.security.*;
public class Edit extends Applet implements ActionListener, ItemListener
String Gselect;
reader readit;
int mhz, khz;
TextField textField1;
String freq = "000.000";
String data;
Choice freqC;
Button ActivateB, SaveB, /*CancelB, HelpB,*/ DeleteB;
Checkbox SetC;
int NotUsedReply[] = new int[200];
int HwListReply[] = new int[200];
public void init()
readit = new reader();
String myFile="satellite.st1";
// myFile = myFile.concat(Gselect);
File satellite = new File(myFile);
textField1 = new TextField();
textField1.setText( "(void) " );
add( textField1 );
SetC = new Checkbox("TRAP-RX");
add(SetC);
SetC.addItemListener(this);
freqC = new Choice();
freqC.setSize(20,50);
freqC.add("000.000");
add(freqC);
freqC.addItemListener(this);
ActivateB = new Button("Activate");
add(ActivateB);
ActivateB.addActionListener(this);
SaveB = new Button("Save");
add(SaveB);
SaveB.addActionListener(this);
DeleteB = new Button("Delete");
add(DeleteB);
DeleteB.addActionListener(this);
/*CancelB = new Button("Cancel");
add(CancelB);
CancelB.addActionListener(this);
HelpB = new Button("Help");
add(HelpB);
HelpB.addActionListener(this);*/
//textField1.setText( data );
for(int a = 1; a < 9; a++)
data = readit.getData(satellite.getAbsolutePath(), a);//("E:\\forte4j\\system\\Projects\\Zebra\\satellite.st1", a);
freqC.addItem(data);
textField1.setText(satellite.getAbsolutePath() );
public void paint(Graphics g)
//g.drawString("Radio Setup Files",20, 20);
//g.drawString(getParameter("wse"),20, 20);
public void actionPerformed(ActionEvent event)
if(event.getSource() == ActivateB)
activator();
if(event.getSource() == SaveB)
/*if(event.getSource() == CancelB)
stop();
if(event.getSource() == HelpB)
if(event.getSource() == DeleteB)
public void itemStateChanged(ItemEvent e)
if(e.getItemSelectable() == SetC)
textField1.setText("Check box 1 clicked!");
if(e.getItemSelectable() == freqC)
freq = ((Choice)e.getItemSelectable()).getSelectedItem();
public void activator()
makeMHZ();
makeKHZ();
if(mhz > 254)
int StartLink[]={0x0c,0x01,0x07,0x00,0x00,0x00,0x00,0x00,0x00}; //New Link Proc Start
int TrapConfig[]={0x25,0x80,0x00,0x00,0x00,0xb7,0x00,0x0c,0x0b, //TRAP Configuration
0x00,0x00,0x00,0xff,0xa0,0xff,0x0d,0xff,0xe8,
0xff,0x0d,0xff,0x00,0xff,0x15,0xff,0xb0,0xff,
0xff,0xff,0x94,0x0a,0x01,0x06,0x1a,0x00,0x0d,
0x2d,0x21};
TrapConfig[11]=(mhz-255);
TrapConfig[12]=(khz/5);
int SetUserOutput[]={0x41,0x42,0x49,0x54,0x52,0x41,0x50,0x20,0x34, //Sets User Output Format
0x35,0x34,0x35,0x30,0x30,0x2e,0x30,0x4e,0x30,
0x38,0x32,0x34,0x35,0x30,0x30,0x2e,0x30,0x57,
0x30,0x31,0x30,0x30,0x2e,0x30,0x30,0x4b,0x4d,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00};
sendget CmdFunc;
CmdFunc=new sendget();
try
//PolicyEngine.assertPermission(PermissionID.SYSTEM);
Socket h = new Socket("192.9.200.155",9000);
Socket s = new Socket("192.9.200.155",9001);
Socket t = new Socket("192.9.200.155",9002);
int j;
CmdFunc.SendCmd(h,0,0x01,null);
CmdFunc.GetCmd(h,HwListReply);
CmdFunc.SendCmd(s,9,0x1e,StartLink); //New Link Proc Start
CmdFunc.GetCmd(s,NotUsedReply);
CmdFunc.SendCmd(s,37,0x00,TrapConfig); //TRAP Configuration
CmdFunc.GetCmd(s,NotUsedReply);
CmdFunc.SendCmd(s,155,0x03,SetUserOutput);//Sets User Output Format
CmdFunc.GetCmd(s,NotUsedReply);
catch(Exception e){}
else
textField1.setText( "000.000 is the null choice. Try another." );
public void receiveText1( String select )
Gselect=select;
public void makeMHZ()
String y = freqC.getSelectedItem();
y = y.substring(0,3);
mhz = Integer.parseInt(y);
//textField1.setText( y );
public void makeKHZ()
String y = freqC.getSelectedItem();
y = y.substring(4,7);
khz = Integer.parseInt(y);
//textField1.setText( y );
import java.awt.*;
import java.applet.*;
import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.LineNumberReader;
import java.awt.event.*;
import com.ms.security.*;
import netscape.security.*;
import netscape.util.*;
public class saver extends Applet implements ActionListener
String nameS = "Data.txt";
String dataS = "Default Data";
Button saveB;
public void init()
saveB = new Button("SaveFile");
add(saveB);
saveB.addActionListener(this);
public void actionPerformed(ActionEvent event)
if(event.getSource() == saveB)
RandomAccessFile RAF;
byte array0[] = dataS.getBytes();
try
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.SYSTEM);
if(Class.forName("netscape.security.PrivilegeManager") != null)
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileWrite");
catch (Throwable cnfe)
try
RAF = new RandomAccessFile(nameS, "rw");
// RAF.writeUTF(dataS);
RAF.write(dataS.getBytes());
RAF.close();
catch(Exception e)
public void receiveND(String name, String data)
if(name != null)
nameS = name;
dataS=data;
import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.LineNumberReader;
//import java.security.*;
import com.ms.security.*;
import netscape.security.*;
import netscape.util.*;
public class reader
//Signature sig;
public String getData(String filename, int pass)
//String nameS = "Data.txt";
String dataS = "Default Data Sucks";
String comma = ",";
int get = pass, count=0, top=0, bottom=0;
char[] work;
try
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.SYSTEM);
if(Class.forName("netscape.security.PrivilegeManager") != null)
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
catch (Throwable cnfe)
try
//sig.sign();
//nameS = filename;
RandomAccessFile RAF = new RandomAccessFile(filename, "r");
// dataS = RAF.readUTF();
dataS = RAF.readLine();
RAF.close();
catch(Exception e)
return e.toString();
work = dataS.toCharArray();
for(int i = 0; i < dataS.length(); i++)
if( work[i] == ',' )
count++;
if(get == count)
bottom = i + 1;
if( (work[i] == ',') && (count > get) && (top == 0) )
top = i;
dataS = dataS.substring(bottom,top);
return dataS;
}import java.awt.*;
import java.applet.*;
import java.net.*;
import java.io.File;
import java.awt.event.*;
//import java.security.*;
//import sun.security.*;
//import java.awt.Window;
//import com.ms.security.*;
public class Edit extends Applet implements ActionListener, ItemListener
String Gselect;
reader readit;
int mhz, khz;
TextField textField1;
String freq = "000.000";
String data;
Choice freqC;
Button ActivateB, SaveB, /*CancelB, HelpB,*/ DeleteB;
Checkbox SetC;
int NotUsedReply[] = new int[200];
int HwListReply[] = new int[200];
public void init()
readit = new reader();
String myFile="satellite.st1";
// myFile = myFile.concat(Gselect);
File satellite = new File(myFile);
textField1 = new TextField();
textField1.setText( "(void) " );
add( textField1 );
SetC = new Checkbox("TRAP-RX");
add(SetC);
SetC.addItemListener(this);
freqC = new Choice();
freqC.setSize(20,50);
freqC.add("000.000");
add(freqC);
freqC.addItemListener(this);
ActivateB = new Button("Activate");
add(ActivateB);
ActivateB.addActionListener(this);
SaveB = new Button("Save");
add(SaveB);
SaveB.addActionListener(this);
DeleteB = new Button("Delete");
add(DeleteB);
DeleteB.addActionListener(this);
/*CancelB = new Button("Cancel");
add(CancelB);
CancelB.addActionListener(this);
HelpB = new Button("Help");
add(HelpB);
HelpB.addActionListener(this);*/
//textField1.setText( data );
for(int a = 1; a < 9; a++)
data = readit.getData(satellite.getAbsolutePath(), a);//("E:\\forte4j\\system\\Projects\\Zebra\\satellite.st1", a);
freqC.addItem(data);
textField1.setText(satellite.getAbsolutePath() );
public void paint(Graphics g)
//g.drawString("Radio Setup Files",20, 20);
//g.drawString(getParameter("wse"),20, 20);
public void actionPerformed(ActionEvent event)
if(event.getSource() == ActivateB)
activator();
if(event.getSource() == SaveB)
/*if(event.getSource() == CancelB)
stop();
if(event.getSource() == HelpB)
if(event.getSource() == DeleteB)
public void itemStateChanged(ItemEvent e)
if(e.getItemSelectable() == SetC)
textField1.setText("Check box 1 clicked!");
if(e.getItemSelectable() == freqC)
freq = ((Choice)e.getItemSelectable()).getSelectedItem();
public void activator()
makeMHZ();
makeKHZ();
if(mhz > 254)
int StartLink[]={0x0c,0x01,0x07,0x00,0x00,0x00,0x00,0x00,0x00}; //New Link Proc Start
int TrapConfig[]={0x25,0x80,0x00,0x00,0x00,0xb7,0x00,0x0c,0x0b, //TRAP Configuration
0x00,0x00,0x00,0xff,0xa0,0xff,0x0d,0xff,0xe8,
0xff,0x0d,0xff,0x00,0xff,0x15,0xff,0xb0,0xff,
0xff,0xff,0x94,0x0a,0x01,0x06,0x1a,0x00,0x0d,
0x2d,0x21};
TrapConfig[11]=(mhz-255);
TrapConfig[12]=(khz/5);
int SetUserOutput[]={0x41,0x42,0x49,0x54,0x52,0x41,0x50,0x20,0x34, //Sets User Output Format
0x35,0x34,0x35,0x30,0x30,0x2e,0x30,0x4e,0x30,
0x38,0x32,0x34,0x35,0x30,0x30,0x2e,0x30,0x57,
0x30,0x31,0x30,0x30,0x2e,0x30,0x30,0x4b,0x4d,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00};
sendget CmdFunc;
CmdFunc=new sendget();
try
//PolicyEngine.assertPermission(PermissionID.SYSTEM);
Socket h = new Socket("192.9.200.155",9000);
Socket s = new Socket("192.9.200.155",9001);
Socket t = new Socket("192.9.200.155",9002);
int j;
CmdFunc.SendCmd(h,0,0x01,null);
CmdFunc.GetCmd(h,HwListReply);
CmdFunc.SendCmd(s,9,0x1e,StartLink); //New Link Proc Start
CmdFunc.GetCmd(s,NotUsedReply);
CmdFunc.SendCmd(s,37,0x00,TrapConfig); //TRAP Configuration
CmdFunc.GetCmd(s,NotUsedReply);
CmdFunc.SendCmd(s,155,0x03,SetUserOutput);//Sets User Output Format
CmdFunc.GetCmd(s,NotUsedReply);
catch(Exception e){}
else
textField1.setText( "000.000 is the null choice. Try another." );
public void receiveText1( String select )
Gselect=select;
public void makeMHZ()
String y = freqC.getSelectedItem();
y = y.substring(0,3);
mhz = Integer.parseInt(y);
//textField1.setText( y );
public void makeKHZ()
String y = freqC.getSelectedItem();
y = y.substring(4,7);
khz = Integer.parseInt(y);
//textField1.setText( y );
import java.awt.*;
import java.applet.*;
import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.LineNumberReader;
import java.awt.event.*;
import com.ms.security.*;
import netscape.security.*;
import netscape.util.*;
public class saver extends Applet implements ActionListener
String nameS = "Data.txt";
String dataS = "Default Data";
Button saveB;
public void init()
saveB = new Button("SaveFile");
add(saveB);
saveB.addActionListener(this);
public void actionPerformed(ActionEvent event)
if(event.getSource() == saveB)
RandomAccessFile RAF;
byte array0[] = dataS.getBytes();
try
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.SYSTEM);
if(Class.forName("netscape.security.PrivilegeManager") != null)
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileWrite");
catch (Throwable cnfe)
try
RAF = new RandomAccessFile(nameS, "rw");
// RAF.writeUTF(dataS);
RAF.write(dataS.getBytes());
RAF.close();
catch(Exception e)
public void receiveND(String name, String data)
if(name != null)
nameS = name;
dataS=data;
import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.LineNumberReader;
//import java.security.*;
import com.ms.security.*;
import netscape.security.*;
import netscape.util.*;
public class reader
//Signature sig;
public String getData(String filename, int pass)
//String nameS = "Data.txt";
String dataS = "Default Data Sucks";
String comma = ",";
int get = pass, count=0, top=0, bottom=0;
char[] work;
try
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.SYSTEM);
if(Class.forName("netscape.security.PrivilegeManager") != null)
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
catch (Throwable cnfe)
try
//sig.sign();
//nameS = filename;
RandomAccessFile RAF = new RandomAccessFile(filename, "r");
// dataS = RAF.readUTF();
dataS = RAF.readLine();
RAF.close();
catch(Exception e)
return e.toString();
work = dataS.toCharArray();
for(int i = 0; i < dataS.length(); i++)
if( work == ',' )
count++;
if(get == count)
bottom = i + 1;
if( (work == ',') && (count > get) && (top == 0) )
top = i;
dataS = dataS.substring(bottom,top);
return dataS;
Maybe you are looking for
-
Insert into date column using EJB3.0 and toplink not working
Hi All, I'm getting the following error whenever I attempt to insert a date value into my Oracle database. [TopLink Fine]: 2006.08.08 05:53:21.973--UnitOfWork(14806807)--Connection(14714759)--Thread(Thread[RMICallHand ler-0,5,RequestThreadGroup])-- I
-
Equipment no longer exists in EQUI but found in EQUZ, EQKT tables
Hi Experts, We found that the few equipments are no longer exists in EQUI, but left with the entries in the tables EQUZ, EQKT.Also, we found that we could able to read the system and user status for these equipments in the JEST table and STATUS_TEXT_
-
Enlarge timeout for RFC Reciver
how can I enlarge timeout for RFC Reciver? I know for WS reciever/sender I can use this parameter XMBWS.Timeout. what do I use for RFC Reciever/Sender and where? Thanks kfir
-
hello, I need execute an SQL dynamic as field's SQL: select field1, '(select field2 from table2)' from table1; And this field2 as output number. It's possible?
-
Publishing through Muse and Hosting through Adobe
To begin with if this is the wrong area for this post please point me to where I need to take it or if a mod wants, please move it. So I bought access to the whole CC suite so that I could learn some new things and expand my abilities but I am mostly