B4J Tutorial [Server] Building web servers with B4J

Discussion in 'B4J Tutorials' started by Erel, Jan 27, 2014.

Thread Status:
Not open for further replies.
  1. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this.
     
  2. orl

    orl New Member

    Hi,

    I was wondering... i would like to post the file to 000webhost
    but im unsure where is the file i need to download to the site...

    could anyone help?

    thanks!

    O.L
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    B4J server projects will not work on a shared hosting. You need a VPS with shell access.
     
  4. orl

    orl New Member

    Erel,

    yea...can you suggest such a place to begin with?

    I want to put a bj4 server on the net and I could not find any guides on how to do that....

    help?

    orl
     
  5. inakigarm

    inakigarm Well-Known Member Licensed User

  6. Erel

    Erel Administrator Staff Member Licensed User

    It will work with any VPS available. You just need to copy Java files and then run the jar file with java -jar <your jar>
     
  7. delozoya

    delozoya Member Licensed User

    Hello. In File Upload, How can change name (MultiPart.........) for original name of file?
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Part.SubmittedFilename should return the original file name.
     
  9. wonder

    wonder Expert Licensed User

    I just gave it the first test drive.
    This is really cool! Thank you so much, Erel! :)
     
    Erel likes this.
  10. jayel

    jayel Active Member Licensed User

    Hello,

    When I try your code on my raspberry pi 2 I get following error... see screenshot...

    Any ideas?
     

    Attached Files:

  11. Erel

    Erel Administrator Staff Member Licensed User

    This means that the link you entered points to a missing resource.

    If you are using B4J-Bridge then you need to manually copy the www folder to the tempjars folder.
     
    jayel likes this.
  12. jayel

    jayel Active Member Licensed User

    I was using B4J-Bridge... thx !
     
  13. vcelak

    vcelak Member Licensed User

    Hi, I have just one question as I not found response for it.

    Is possible to set File.DirAssets as srvr.StaticFilesFolder???

    I tried it, but it always return 404... as /. was not found. I added everything to Files folder, all file names are also lower case.

    I need to have all files except log directory, config file and sqlite file located in assets folder as it will be then easy to distribute my app as only one executable archive without possibility to manually change anything in static html code...
     
    Last edited: May 15, 2016
  14. Erel

    Erel Administrator Staff Member Licensed User

    It is not possible.

    Note that the jar file is a simple zip file so it will not add any real protection anyway.
     
  15. vcelak

    vcelak Member Licensed User

    Hi Erel, I know that jar file is simple zip file, but my final thinking was to provide whole app as packaged exe file, where it will not be so simple to "hack" anything...

    Second question - when I add also subfolders to assets ("Files") directory, then I found that compiled jar contains only files I added via IDE - there is not possible to add subfolders... Is this bug? As at somewhere at this forum I found it may work.
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Subfolders inside the assets folder are not supported.

    You can create a zip file with all the files you need and then unpack it at runtime. For further discussion please start a new thread.
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice