Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Subrata Pradhan

Greenhorn
+ Follow
since May 05, 2012
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 Subrata Pradhan

i have already signed that applet bt still its not running
6 years ago
Hiiii all. i want to make an applet which is fetching the system data like bios version and machine name etc. My java class file is working f9 when i m executing it wid main method bt when i convert it an applet is not working. I cant make out the problm need help guys.

Exception :


My Class File :

HTML:
6 years ago
Hello I am newbie in JSF. At present I am facing a strange problem when using ajax in my UI. I am getting null value of field which value sets by ajax operation in ManageBean Class. I am using jsf 2.1 with primefaces.

shiftMaster.xhtml
<h:form id="shiftForm">
<h:panelGrid columns="2">
<p:outputLabel value="Start time" for="startTime"/>
<p:spinner id="startTime" value="#{shiftMasterService.selectedShiftPojo.startTime}" min="00.00" max="24.00">
<f:ajax event="blur" render=":shiftHours" execute="startTime endTime"/>
</p:spinner>
<p:outputLabel value="End time" for="endTime"/>
<p:spinner id="endTime" widgetVar="eTime" value="#{shiftMasterService.selectedShiftPojo.endTime}" min="00.00" max="24.00">
<f:ajax event="blur" render=":shiftHours" execute="startTime endTime" />
</p:spinner>
<p:outputLabel value="Shift Hours" for="shiftHours"/>
<h:inputText id="shiftHours" value="#{shiftMasterService.timeDifference}" style="align:right" readonly="true" />
</h:panelGrid>
<p:panelGrid columns="2" style="width:100%">
<f:facet name="footer">
<p:commandButton value="Save" update=":mainForm" oncomplete="dlg.hide()" action="#{shiftMasterService.save()}"/>
</f:facet>
</p:panelGrid>
</h:form>

ShiftMasterPojo
private Double startTime;
private Double endTime;
private Double shiftHours;

Setter getter

ShiftMasterService
@ManagedBean(name="shiftMasterService")
@SessionScoped
public class ShiftMasterService {
private ShiftMasterPojo selectedShiftPojo;
setter getter

public Double getTimeDifference()
{
double timeDiff = 0.0;
System.out.println("GET TIME DIFFERENCE......");
if(selectedShiftPojo.getEndTime()==null && selectedShiftPojo.getStartTime()==null)
return timeDiff;
else
{
timeDiff = selectedShiftPojo.getEndTime() - selectedShiftPojo.getStartTime();
return timeDiff;
}
}

public void save()
{
System.out.println("Shift Hour>>"+selectedShiftPojo.getShiftHours());
new ShiftMasterDao().save(selectedShiftPojo);
}
}

When i am submit the Shiftform, getting null value of shiftHour field in save method of ManageBean Class(ShiftMasterService) . plzzz help me.
7 years ago
JSF
is there any way to stop execution of finally block using deamon thread?? actually few days back one IBMer guy told me that we can stop the execution of finally block using deamon thread...so if its possible.. please explain...
7 years ago
how to send ByteArray from flex to java?? I dnt have any scope to use BlazeDS or something lyk dat...is there ne other way lyk HttpService..though i hv used httpservice bt its not working...
7 years ago
Can anyone please give me detail explanation what is Singletone class or design pattern?? when we are going to use it with example???
8 years ago

Rob Spoor :
OK, so you already are able to get an InputStream for the uploaded file. What you now need to do is create a FileOutputStream, and copy all contents from the InputStream to that FileOutputStream. Make sure to close both streams when you're done with it, in a finally block.



Thanks Rob...thanks for the help :)
8 years ago
JSP
I am facing a problem for few days to move a video file from a client machine directory to a specific directory in server . I am using multipart/form-data for choosing multiple video files(*.flv) and commons-fileupload.jar and commons-io.jar for uploading purpose.

My Jsp File:


JAVA CODE:
8 years ago
JSP