• Post Reply Bookmark Topic Watch Topic
  • New Topic

Integrate java with jsp

 
Irvan Kosini
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have JSP for sending value

kirim.JSP


dokirim.JSP


dopindah.JSP


ProcessBuilderExample.java


How to integrated this java class to dopindah.JSP and and get the session for running the linux command ?
if i use ordinary runtime exec it wont wait until the linux command process end. so i'm thinking using processbuilder

i need mv command run when the file saved on pc, and then if i use my previous code, it wont wait until the file saved.
 
Greg Charles
Sheriff
Posts: 3010
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, first, you really don't want to use scriptlets ... that is, don't embed Java code into the JSP using <% ... %> tags. Instead, send your post requests to a Java servlet, and let it do the processing. The servlet can put any computed values you need into request attributes, and then forward the request to a JSP. The JSP can access request attributes via Expression Language (EL), so you'll never need to embed Java code into it.

For your ProcessBuilderExample class, instead of making it a standalone Java application with a main method, how about rewriting it to have a method that returns a value? Your servlet could call that method and put the result into a request attribute.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!