Akhilesh Yadav

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

Recent posts by Akhilesh Yadav

Hi All,

As we all know int range is (–2,147,483,648 to 2,147,483,647).

below is the code

int a=2147483647; //1

int mul=a*2; //2
int add= a+2; //3

System.out.println(mul);
System.out.println(add);

out put is

-2
-2147483647

The question is when declaring int if we declare more thani nt range it gives complie time error...
but when we are using the same variable which is in range and we add or multiply it as in above
at runtime is give some junk values


how do we know at runtime int value will be gretae then its range .
do we need to explicitky check by using if condition ...
Can an .ear contain more than one .war and .jar files
<%@ page language="java" isErrorPage="false"%>
<jsp:directive.page import="java.util.*,java.awt.*,javax.imageio.*,java.io.*,
java.awt.image.*,com.gts.ffp.valueobjects.UserInfoVO;" />
<%@ page autoFlush="true" buffer="1094kb"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<TITLE>Member Card</TITLE>
</head>
<body>
<%
try {
%>
<%
String loyality_id1 = (((UserInfoVO) session.getAttribute("UserInfo")).getUserID());
ServletContext ctx = getServletContext();
String imgPath=(String)session.getAttribute("imgPath").toString();
String strFile=imgPath.substring(6,imgPath.length());
response.setContentType("image/png");

File f= new File(strFile);
FileInputStream is =new FileInputStream(f);

out.clear();
out = pageContext.pushBody();

int read= 0;
byte [] bytes= new byte[1024];
ServletOutputStream out1 = null;

out1 = response.getOutputStream(); //ERROR LINE

while((read=is.read(bytes))!=-1){
out1.write(bytes,0,read);

}
out1.flush();
%>

<%
} catch (Exception e) {
System.out.println("Error ::::::::::: in MEMBER VIEW " + e);
}
%>
</body>
</html>

ABove is the Code when ever i try to run this code it gives me following Error
java.io.IOException: Attempt to clear a buffer that's already been flushed
it gives error on this line out1 = response.getOutputStream();

please let me know how to solve this problem
17 years ago
JSP
Hi guys,

my Problem is i want to write on image some data and Store it on Server and then again Display it when user login in JSP page

here is the code which i have written


<img src="<%=strFile%>"> --> this displays a new Image on JSP page

this code runs fine on my computer but the problem is when i run this some code on different computer using my IP adress or URL new image is not Displayed

please help me out ..



[BSouther: Added UBB CODE tags]
[ January 31, 2008: Message edited by: Ben Souther ]
17 years ago
How to Retrive Data from Query with multiple joins in HQL

Follwing is my Query i have Stored in lst and now i have to retrive each record.
i am Getting it in Object
How to Retrive Actual data ....


Query qry = getSession().createQuery("from com.gts.radixx.hibernate.Flightmstr flightmstr, " +
" com.gts.radixx.hibernate.Pnr pnr, com.gts.radixx.hibernate.PaxDetails pax_details " +" where flightmstr.flightId = pnr.flightmstr.flightId and " +" pnr.pnrNo = pax_details.pnr.pnrNo " +" and flightmstr.deptAirport = '"
+ deptAirport + "' and flightmstr.arrvAirport = '"+ arrAirport + "' and flightmstr.deptDate = '"+ deptDate + "' and pnr.pnrNo = '"+ pnrno + "'");
lst = qry.list();
Hi All,

How to call a Spring bean from webwrork action class?
Hi guys i know JAVA/J2EE (JSP/SERVLETS/EJB)
I want to learn webwork frame work

can anybody recommend me any books or website realte to WEBWORK FrameWork
do i need to know knlowledge of Struts to learn webwork framework
As we all know every jsp is converted in to servlet

when in write jsp declration tag <%! public void a(){} %>
this will go into init() method of servlet

but when i write Expression <% public void a(){} %>
this will go into service() method of servlet

in expression tag it ie.service() shows error illegal start of expression .....

why it doesnt show in init() method the same error because even init() is a method.
18 years ago
As we all know every jsp is converted in to servlet

when in write jsp declration tag <%! public void a(){} %>
this will go into init() method of servlet

but when i write Expression <% public void a(){} %>
this will go into service() method of servlet

in expression tag it ie.service() shows error illegal start of expression .....

why it doesnt show in init() method the same error because even init() is a method.
18 years ago
JSP
Hi Rahul thnks for the Reply but i have some doubts still
1)What do you mean by callback methods ?
2)As you said we have to intiate session by request.session() is there any Difference between HttpSession session = request.HttpSession();
18 years ago
please answer the Following Questwions

1) if I directly close the browser in which servlet in running at that time will my Destroy Method willb called ?

2) if my server crashes willtht time Destroy method will be called ?

3) As soon as visit any webpage does session gets Automatically started
18 years ago
Hi Does anyone Knows BLUE MARTINI framwork

does it have good future in coming years if i start workign on it
please guide
Please tell the use of interfce and abstract class

when to use interface and when to use abstract class
I tried connecting from JSP to crystal report but i get follwing error please help :

com.crystaldecisions.sdk.occa.report.lib.ReportSDKParameterFieldException: Information is needed before this report can be processed.---- Error code:-2147213303 Error code name:invalidParameterField
at com.crystaldecisions.sdk.occa.report.lib.ReportSDKParameterFieldException.throwReportSDKParameterFieldException(Unknown Source)
at com.crystaldecisions.sdk.occa.managedreports.ps.internal.c.a(Unknown Source)
at com.crystaldecisions.sdk.occa.managedreports.ps.internal.c.getPromptDatabaseLogOnInfos(Unknown Source)
at com.crystaldecisions.report.web.component.h.a(Unknown Source)
at com.crystaldecisions.report.web.component.h.if(Unknown Source)
at com.crystaldecisions.report.web.component.h.int(Unknown Source)
at com.crystaldecisions.report.web.component.n.a(Unknown Source)
at com.crystaldecisions.report.web.event.b1.broadcast(Unknown Source)
at com.crystaldecisions.report.web.event.as.a(Unknown Source)
at com.crystaldecisions.report.web.WorkflowController.if(Unknown Source)
at com.crystaldecisions.report.web.WorkflowController.doLifecycle(Unknown Source)
at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)
at com.crystaldecisions.report.web.ServerControl.processHttpRequest(Unknown Source)
at com.ibm._jsp._CrystalReportViewer._jspService(_CrystalReportViewer.java:87)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:171)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionProcessor.handleRequest(JSPExtensionProcessor.java:230)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2837)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
18 years ago
see I calculate 13
as 0 0 0 0 1101 ---->13
128643216 8421

add all bit having 1 so it gives 8+4+1=13

as you told
0000 1111 --- >15
~
----------
1111 0000 ==> 240

am i calculating in wrong way please let me know
[ January 11, 2007: Message edited by: Akhilesh Yadav ]