Rohit Malhotra

Greenhorn
+ Follow
since Jan 29, 2006
Merit badge: grant badges
For More
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 Rohit Malhotra

Hi can anyone pelase help me out.


What i believe is tehres a diffeernt Exception from the xerces which is getting wrapped into InvockationTargetException . Since i do no thave the source for Xerces i m unable to debug the same. Can anyone please help me out. Its rreally do or die situation for me ...
17 years ago
yes the host is well reachable. Besides i am using my IP address in the Java2WSDL and AdminClient tool.
17 years ago
Hi i m facing an error while deploying a simple Web Service using Axis.


Can anyone please me out. I m using Websphere 5.1.2 and Axis 1.2(AdminClient)
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.InvocationTargetException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:IFLMUD5HP0779

java.lang.reflect.InvocationTargetException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:1792)
at org.apache.axis.client.AdminClient.process(AdminClient.java:439)
at org.apache.axis.client.AdminClient.process(AdminClient.java:404)
at org.apache.axis.client.AdminClient.process(AdminClient.java:410)
at org.apache.axis.client.AdminClient.process(AdminClient.java:320)
17 years ago
Hi,

I am using Apaches FileItem API for FIle upload Functionality into the Server. However its allowing me to upload only text files. (*.txt). How can i upload Word,PDF Excel Files .? Thankin in advance,

Regards,
17 years ago
Hi,

I am writing an Application which allows files to be uploaded ,checked in

and checked out of the Applciation . I am using Apaches FileUpload Class

for hte upload Functionality.

I am maintaining a backup of the files by converting the file data

into String and storing ti in CLOB datatype in the Database.

Now wehn the Application starts, i am using Context listners to intialize

the application with the data of the file from the DATABASe.

Can anyone please let me know how can i construct an FileUpload object

using the String data from the Database? Thanking in advance,

Regards.
Rohit
17 years ago
Hi,

I am making only .war file of my Application . I am not using any EJBS just servlets and JSPS. So should the above suggestion work or what should i use?
Please let me know. Thanking in advance,

Regards,
18 years ago
JSP
Hi,

I want to log all the events in the application into a file log.txt
How can a write to a file through a servlet. I do need the absolute path of the file. like for example the file is in docs folder of the base directory of my application project.

BASE_DIR
- WEB-INF/CLASSES
- WEB-INF/Web.xml
- SRC
- DOCS/Log.txt

How can i write to this file log.txt through my Servlet?
Thanking in advance,
18 years ago
Hi,

I am sorry. But can you explain in more Details. or give me an idea about the code?
18 years ago
Hi,

I am kinda writing an Application that allows users to upload , checkin and Check out files. I am done with Upload Code.for the Checkout code i wish to allow the user to be able to download files. i am using the following JSP

<%@page import="java.util.*,user.UserFiles,java.io.*,org.apache.commons.fileupload.*;"%>
<html>


<body>
<%
try
{
UserFiles userFile = (UserFiles)request.getAttribute("CheckoutFile");
response.setContentType("application/unknown");
response.addHeader("Content-Disposition", "attachment; filename="+userFile.getFileName());
FileItem checkoutItem = userFile.getFile();
InputStream fis = checkoutItem.getInputStream();
PrintWriter pw = response.getWriter();
int c=-1;
// Loop to read and write bytes.
//pw.print("Test");
while ((c = fis.read()) != -1)
{
pw.print((char)c);
}
// Close output and input resources.
fis.close();
pw.flush();
pw=null;
}catch (Exception er)
{
er.printStackTrace();
}
%>

<h4>Display JSP</h4>
<h4><% out.println("Download Successful"); %><h4>
<form action="UserTask.jsp">
<input type="Submit" value="click here to go back">
</form>
</body>
</html>

And i am calling this JSP from the Servlet...


{
p_request.setAttribute("CheckoutFile",l_checkfile);
RequestDispatcher d_dispatcher = p_request.getRequestDispatcher("Display.jsp");
d_dispatcher.forward(p_request,p_response);
}


The problem i am facing out here is that servlet simply doesnt pass the conrtol to the JSP page. Rather . as i execute the servlet , a window pops up allowing me to donwload the file from the Server but the control remains with the Servlet. it doesnt get passed to the JSP page. please can anyone suggest whats going wrong? Thanking in advance,

Regards,
18 years ago
Hi,

I am posting this question again because it hasnot be answered yet. Please help meout.

i am writing an application whcih allows Users to upload Fils onto the BEA Weblogic Server

My JSP is something like this

<form name="uploadForm" method="post" action="upload" enctype="multipart/form-data" onSubmit="return validate()">
<input type="submit" value="Update" name="Option">
<input type="submit" value="Upload" name="Option">
<input type="submit" value="Search" name="Option">
<input type="submit" value="Checkin" name="Option">
<input type="submit" value="Checkout" name="Option">
<input type="submit" value="Delete" name="Option"><br><br>
<input type="file" name="fileName"><br>
<input type="text" name="checkout"><br>
<input type="submit" value="CheckoutDirectory"><br>


And the Servlet that uploads file is :-




The problem i am facing here is that What do i use to transfer control from servlet to the JSP to allow more files for upload. If i use RequestDispatcher it fails when i try to checkout the File. If i use Response.sendRedirect("UserTask.jsp"); it fails with java.net.SocketException. I am using BEA Weblogic Server. Please help me out.

[Edit by Dave - code tags added]
[ March 02, 2006: Message edited by: David O'Meara ]
18 years ago
Hi,

I am kinda write a file upload Application where the User gives the input file and the Servlet uploads it and now i want to transer the control back to the JSP allowing more files to be uploaded.
What should i use. RequestDispatcher.forward("UserTasks.jsp") or response.sendRedirect("UserTasks.jsp");
Also when i try using response.sendRedirect i keep on getting this error:=

java.net.SocketException: Software caused connection abort: socket write error

My jsp page is in the Application root directory and the servlet classes are in root\web-inf\classes directory..
18 years ago
I am using a third party tool typically FileUpload jar from apache.
18 years ago
JSP
Hi,

I have written a JSP for File Upload which has a form element
<"FORM ENCTYPE="multipart/form-data">
<input type="submit" name="option" value="upload">
<input type="submit" name="option" value="check-in">
</form>
the problem is now. i want to check which button is clicked. by request.getPArameter("option"); however. it does not return any value since the enctp is mulipart/form. Can anyone please let me know how can i check which button is clickd?
Reggards,
18 years ago
JSP
Hi,
I want to set a particular JSP page as the home page for the application and allow acess to the application only through the home page. I am using BEA Weblogic Server. Please let me know.
Thanking in advance,

Regards,
18 years ago
JSP
Hi,

I need to execute a servlet of the Application on startup to perform some Data Retrieval Tasks. How can i achieve teh same using BEA Weblogic Server?]
What settings need to be set?

Thanking in advance,

Regards,
18 years ago