this question has answer here: how send form input values , invoke method in jsf bean 1 answer i error when trying send values jsf page bean. i want set values fields in bean, create airplane instance , add database. error telling me use illegal syntax setter part of bean. why error? didnt find on site helped me problem. here jsf part: <h4>add plane</h4> <c:if test="#{not empty listairplanebb.error}"> <div class="alert alert-danger"> <span class="glyphicon glyphicon-remove"></span> <h:outputtext value="#{listairplanebb.error}" /> </div> </c:if> <h:form> <table class="table"> <thead> ...
using java 8. basically, in unit test (junit) have code: callsomecode(); asserttrue(new file(this.getclass().getresource("/img/dest/someimage.gif").getfile()).exists()); in callsomecode() , have this: inputstream = bodypart.getinputstream(); file f = new file("src/test/resources/img/dest/" + bodypart.getfilename()); //filename being someimage.gif fileoutputstream fos = new fileoutputstream(f); byte[] buf = new byte[40096]; int bytesread; while ((bytesread = is.read(buf)) != -1) fos.write(buf, 0, bytesread); fos.close(); the first time test runs, this.getclass().getresource("/img/dest/someimage.gif") returns null although file created. the second time (when file created during first test run overwritten), non-null , test passes. how make work first time? should configure special setup in intellij automatically refresh folder file created? note have basic maven structure: --src ----test ------resources as comment n...
Comments
Post a Comment