minhdung tran

Greenhorn
+ Follow
since Dec 19, 2007
Cows and Likes
Cows
Total received
1
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 minhdung tran

Thanks so much for helping me. But I tried to renamed the class to com.google.cloud.bigquery.samples.BigQueryJavaGettingStarted ; and did exec:java from the maven -> build from eclipse.
I still got the same error message as the one I got earlier.
It could not find com.google.cloud.bigquery.samples.BigQueryJavaGettingStarted.

So please advice me on what to do next.
7 years ago
Hello All,
I am using maven in Eclipse Luna, and I got stuck with an error message when I build my project from maven. The error was


I have a hard time to understand why it could not find my class even though i clearly defined it in my POM.xml

My POM.xml as




So any help would be greatly appreciated.

Thanks,
Tom
7 years ago
Hello,

I just need to import javax-faces-api.jar file into my project library , and the problem solved.

Thanks,
Tom
8 years ago
Hello,
I am running into an annotation problem in RAD 7.5. It did not recognize the annotation of @ManagedBean when i declared it in one of my managed bean class for my java server faces project.
It did not also recognize the import javax.faces.bean.ManagedBean; and javax.faces.bean.SessionScoped in my managed bean class either.

I don't know if some of you have ran into the same problem , and what do you do to fix it?

Thanks so much in advance,
Tom
8 years ago
Hello,

I have a question regarding to running shell script from my java program , and I wish to get your advice.

I am eclipse and I have my shell script located at /HelloSoapServer/runwsgen.sh . The root of my project is at /HelloSoapServer.

I am running a java program to execute the shell script and the java program is




However, when I ran this java program , I got error message saying :


java.io.IOException: Cannot run program "./runwsgen.sh": CreateProcess error=193, %1 is not a valid Win32 application


I would like to ask how to get rid of the error , and secondly I am running from a window 7 environment so I guess I am running from a 64 bits machine, not win32 application as it stated.

Thanks so much in advance.
9 years ago
Good afternoon,
Hope you all have a pleasant afternoon.

For my school project, i would like to return a PDF file from my file system using a servlet's response.getOutputStream method.
It seems to be very straight forward operation, but somehow it does not work. It gave me an unclear message such as "There is a problem with adobe acrobat reader. Please exit and try again (1014:1014) which i don't understand. I have a good copy of acrobat reader and i don't know why it said that i have a problem with it?

Anyway, here is my code and if you see something wrong , please let me know. I am very thankful of all of your help.

10 years ago
Good morning,
Thanks for your help. I displayed it and it gave me the path to my file system which resided on the C drive, not the server
path as i would like the image to be stored which is under myApp/WebContent/Upload/.

Also the program ran without any error but the image never store there myApp/WebContent/Upload/.


I don't know what i did wrong. Please help me if you could.

Thanks alot!

Tom
Paul,

Sorry for not making myself clear. I don't know how to display the path of the file name variable



it should be at the /WebContent/Upload/image.gif as it indicated earlier in the context root and the setRepository




But it did not appear so. I think i miss some important point in my code

[code = java]
File saveFile = new File("/"+fileName);


[/code]


Thanks.
Paul,
sorry for missing the information to the problem. The code did not give me any error but it did not work as it should.
I think i may miss important component since in the code, i would like it to store the image at the /WebContent/upload folder in the server, but the image was not there when i ran it.

Thanks.
Good afternoon,
I am having problem of saving an image to the /WebContent/images/ folder in my server. I think i may have missed something important in my codes , and i wonder if you all have any solution for it.

Below are my jsp code and java code








Thanks for all of your help.

Tom
Good morning, I have a very simple program which downloads a text file from my server c drive c:\mydir\test.txt to a user's computer specific drive. However, the program constantly giving me error telling me that "The system cannot find the path specified". I don't know what is going wrong in the program and why the servlet could not find the specific file test.txt in my c drive c:\mydir\test.txt. Attach is my program for you to review.
<%@ page import="java.io.FileInputStream" %>
<%@ page import="java.io.BufferedInputStream" %>
<%@ page import="java.io.File" %>
<%@ page import="java.io.IOException" %>


<%

// you can get your base and parent from the database
String filename="test.txt";

String filepathServer = "c:\\mydir\\";

BufferedInputStream buf=null;
ServletOutputStream myOut=null;

try{

myOut = response.getOutputStream( );
File myfile = new File(filepathServer+filename);


out.println ("Server file " + myfile + "\n");


//set response headers
response.setContentType("text/plain");

response.addHeader(
"Content-Disposition","attachment; filename="+ filename );

response.setContentLength( (int) myfile.length( ) );

FileInputStream input = new FileInputStream(myfile);
buf = new BufferedInputStream(input);
int readBytes = 0;

//read from the file; write to the ServletOutputStream
while((readBytes = buf.read( )) != -1)
myOut.write(readBytes);

} catch (IOException ioe){

throw new ServletException(ioe.getMessage( ));

} finally {

//close the input/output streams
if (myOut != null)
myOut.close( );
if (buf != null)
buf.close( );

}



%>
10 years ago
Good morning, I have a very simple program which downloads a text file from my server c drive c:\mydir\test.txt to a user's computer specific drive. However, the program constantly giving me error telling me that "The system cannot find the path specified". I don't know what is going wrong in the program and why the servlet could not find the specific file test.txt in my c drive c:\mydir\test.txt. Attach is my program for you to review.
10 years ago
Hello,
I spent 2 weeks to try to figure out why the input row select on a data table does not work. I still trying to find out and have no clue. The problem is the method setSelected() never get called in the managed bean eventhough i select the row on the data table. If you happen to know the problem, please show me. I have the jsf as follow
==========================================================
<h:form styleClass="form" id="form1"><p><h:dataTable border="0"
cellpadding="2" cellspacing="0" columnClasses="columnClass1"
headerClass="headerClass" footerClass="footerClass"
rowClasses="rowClass1" styleClass="dataTable" id="table1" value="#{pc_OrderSearch2.orderResponse.orderErrorAsArray}" var="varorderErrorAsArray">
<h:column id="column7">
<hx:inputRowSelect styleClass="inputRowSelect" id="rowSelect1"
value="#{pc_OrderSearch2.selected}"></hx:inputRowSelect>
<f:facet name="header"></f:facet>
</h:column>
<h:column id="column2" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="PatFirstName" id="text2"></h:outputText>
</f:facet>
<h:outputText id="text3" value="#{varorderErrorAsArray.patFirstName}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column3" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="PatEMPI" id="text4"></h:outputText>
</f:facet>
<h:outputText id="text5" value="#{varorderErrorAsArray.patEMPI}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column4" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="PatLastName" id="text6"></h:outputText>
</f:facet>
<h:outputText id="text7" value="#{varorderErrorAsArray.patLastName}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column5" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="PatMiddleName" id="text8"></h:outputText>
</f:facet>
<h:outputText id="text9" value="#{varorderErrorAsArray.patMiddleName}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column6" >
<f:facet name="header">
<h:outputText styleClass="outputText" value="OrderErrorId" id="text10"></h:outputText>
</f:facet>
<h:outputText id="text11" value="#{varorderErrorAsArray.orderErrorId}" styleClass="outputText" >
</h:outputText></h:column>
<h:column id="column1">
<f:facet name="header">
<h:outputText id="text1" styleClass="outputText"
value="Column 1"></h:outputText>
</f:facet>
</h:column>
</h:dataTable><hx:commandExButton type="submit" value="Submit"
styleClass="commandExButton" id="button1" action="#{pc_OrderSearch2.doButton1Action}"></hx:commandExButton></p></h:form>
===========================================================================

The managed bean as follow

==========================================================================
boolean selected[] = new boolean[50];

public void setSelected(boolean[] selected)
{
log.debug("Set selected !!!");
this.selected = selected;
}


public boolean[] getSelected()
{
return selected;
}
public String doButton1Action() {
// Type Java code that runs when the component is clicked
boolean[] result = getSelected();

// TODO: Return outcome that corresponds to a navigation rule
for (int i = 0; i < result.length; i ++)
{
log.debug("selectd values " + result[i]);
}


//log.debug ("Select row is " + selectedRow.getIntRows());
return "detail";
}

========================================================================
14 years ago
JSF