Gå til innhold

Webkafeen


Anbefalte innlegg

Videoannonse
Annonse
Sammenligner du med === i PHP må vel datatypen go innholdet i den vere identisk, i Java må datatypen vere identisk uansett?

 

Stemmer, ellers får du vel en kompileringsfeil. == i Java sammenligner objektreferanser på ikke-primitive variabler, ikke verdier, så hvis du kopierer en streng kan du muligens få == til å virke som i PHP, men det er jo absolutt ikke optimalt.

Lenke til kommentar
JSP er for øvrig sykt tungvindt i forhold til PHP. Hvorfor finnes/brukes det i det hele tatt? Noen som vet?

Jeg bruker JSP til daglig. Programmerte hovedsakelig i PHP noen år tidligere, og lengter absolutt ikke tilbake. Java EE er i mye større grad designet med tanke på god arkitektur, og i prosjekter av en viss størrelse er det veldig, veldig viktig. Nå kan man jo til en viss grad utøve god arkitektur i PHP, men det er forsvinnende få som faktisk gjør det, bare se på kildekoden til prosjekter som phpBB (frysninger).

 

Nå har jo JSF erstattet JSP på mange måter, men JSP er fortsatt et godt og velytende alternativ med MVC-orientert design og fine rammeverker (JPA, log4j). Det tar jevnt over mye lengre tid å sette seg inn i enn PHP, så nytten er kanskje størst på prosjekter over et par tusen kodelinjer.

 

Arve: Det er sykt mye styr med datatyper, for eksempel. (Variabel == "hallo"), altså sammenlikning av strenger, funker ikke, såvidt jeg kan se, så man må bruke egne funksjoner for den jobben. Kobling mot mySQL er et helvete i forhold til PHP, og krever flere lange kodelinjer. Feilmeldingene er som regel ubrukelige.

"==" tester jo om det er samme objekt, du er nok ute etter .equals().

 

Slik kobler jeg til databaser (bruker JPA).

	@PersistenceUnit
EntityManagerFactory emf;

 

Og tilkoblingsinfo er definert i en datasource-fil. Veldig snedig å ikke ha dette liggende i koden, siden databasebrukeren gjerne er ulik avhgenig om det er lokalt, på testserver eller i produksjon. Også greit at du kan bytte fra MySQL til et titalls andre databaser ved bare å endre et par linjer i datasource-filen.

 

<datasources>
 <local-tx-datasource>
 <jndi-name>databaseDS</jndi-name>
 <connection-url>jdbc:mysql://localhost:3306/database</connection-url>
 <driver-class>com.mysql.jdbc.Driver</driver-class>
 <user-name>bruker</user-name>
 <password>passord</password>
</datasources>

 

Feilmeldingene er jo veldig greie: melding, type og stacktrace, hva mer trenger du? Siden det er såpass systematisk skjønner jeg som regel feilen selv om den ligger i ekstern kode, vil si at det er en av de store fordelene med Java/JSP.

Lenke til kommentar

Skal du melde deg ut av klubben min, Haraldson? Vi har jo sverget på både tabellbruk, <font> og <br> (<br /> anbefales ikke)!

 

Dette er min favoritt URL:

http://www.eddamedia.no/eway/default.aspx?id=271&trg=Content_5594&Main_5571=5594:0:10,1731:1:0:0:::0:0&Content_5594=5577:0:10,1736:1:0:0:::0:0

Endret av sparks
Lenke til kommentar
http://www.thelongestlistofthelongeststuffatthelongestdomainnameatlonglast.com/wearejustdoingthistobestupidnowsincethiscangoonforeverandeverandeverbutitstilllookskindane
tinthebrowsereventhoughitsabigwasteoftimeandenergyandhasnorealpointbutwehadtodoitanyways.h
ml

Endret av loathsome
Lenke til kommentar

Denne er definitivt min favoritt

 

 

http://www.samsungwireless.com/techtrain/tekweb/support/downloads/EULA_popup_sgh_i607_patch.html?terms=End+User+License+Agreement+%28%22EULA%22%29%0D%0A%0D%0ADo+not+install+or+use+the+software+until+you+have+read+and+accepted+all+of+the+license+t
rms.+Permission+to+use+the+software+is+conditional+upl+of+the+license+on+your+agreeing+to+
he+license+terms.+Installation+or+use+of+the+software+bour+agreeing+to+the+license+y+you+w
ll+be+deemed+to+be+acceptance+of+the+license+terms.+Acceptance+will+u+will+be+deemed+to+be
acceptance+of+the+license+bind+you+to+the+license+terms+in+a+legally+enforceable+contract+
ith+Samsung+Electronics+Co.+Ltd.%28hereinafter+the+%22SAMSUNG%22%29+%0D%0A%0D%0A*+SOFTWctronics+ARE+LICENSE+AND+LIMITED+WARRANTY%0D%0AThis+is+an+agreement+between+you%2C+thLICENSE+AND+LIMITED+e+end+user%2C+and+SAMSUNG.+By+using+this+software%2C+you+agree+to+become+boud+nd+by+the+terms+of+this+agreement.+%0D%0AIf+you+agree+to+abide+by+these+condy+the+terms+of+this+itions%2C+please+click+%22Confirm%22+after+you+choose+%22I+accept+the+terms+in+the+license+agreement.%22%0D%0A%0D%0AIF+YOU+DO+NOT+AGREE+TO+THE+TERMS+OF+he+license+THIS+AGREEMENT%2C+PLEASE+DO+NOT+USE+THIS+SOFTWARE+AND+PROMPTLY+REMOVE+IT+FRO+M+YOUR+COMPUTER.%0D%0A%0D%0A*+GRANT+OF+LICENSE%0D%0ASAMSUNG%2C+as+licensor%2UR+C+grants+to+you%2C+the+licensee%2C+a+non-exclusive+right+to+install+the+accoants+to+mpanying+software+program%28s%29+%28hereinafter+the+%22SOFTWARE%22%29+on+a+cying+software+ertain+number+of+computer%28s%29+in+accordance+with+the+number+of+the+licensin+number+of+e+you+purchase+and+use+the+SOFT
ARE+in+accordance+with+the+terms+contained+in+this+license.+You+shall+not+rent%2C+lease%2C+sublicense%2C+modify%2C+alteris+%2C+reverse+engineer%2C+disassemble%2C+decomplie%2C+or+create+any+derivativereverse++work+of+the+SOFTWARE%2C+or+remove+any+copyright+notice+or+proprietary+legenk+of+the+d+contained+in+the+Software
+You+shall+not+reproduce+the+SOFTWARE+unless+forntained+in+the++backup+purpose+and+limited
to+one+copy+only.+Except+for+the+Software+markedkup+purpose+and+limited+to+one+copy++%22Not+for+Resale%22+or+the+like%2C+you+may+transfer+the+Software+on+a+permNot+for+anent+basis+to+another+person+or+entity+
ccompanying+the+Documentation+and+the+license+agreement%2C+provided+that+you+retain+no+copies+of+the+Software+aicense+nd+the+transferee+agrees+to+
he+terms+of+this+agreement.+Such+transfer+will+he+transferee+agrees+to+the+terms+of+this+c
use+an+automatic+termination+of+your+license+to+use+the+Software.%0D%0A%0De+an+automatic+termination+of+your+license+to+use+the+%0A*+OWNERSHIP+OF+SOFTWARE%0D%0ASAMSUNG+retains+the+copyright%2C+title+and+o+OWNERSHIP+OF+wnership+of+the+SOFTWARE+and+the+written+materials+%28%22Documentation%22%29ship+of+the+SOFTWARE+and+the+written+materials++regardless+of+the+form+or+media+in+or+on
which+the+original+and+other+copies+may+exist.%0D%0A%0D%0A*+UPGRADES%0D%0AIf+this+copy+of+the+Software+is+an+upgrade+from+an+earlier+version+of+the+Software%2C+it+is+provided+to+you+on+upgrade+from+an+earlier+version+of+the++license+exchange+basis
+Upon+your+installation+and+use+of+this+copy+of+the+license+exchange+Software%2C+you+agree+to+voluntarily+terminate+your+earlier+EULA+and+you+will+not+continue+to+use+t
e+earlier+version+of+the+Software+or+transfer+it+to+another+person+or+entity.%0D%0A%0D%0A*+USE+OF+PICTURES+LICENSED+BY+THIRD+PARTIES+or+other+person+or+TIES%0D%0AYou+may+use+pictures%2C+if+any%2C+provided+in+the+SOFTWARE%2C+which+may+be+licensed+from+third+parties%2C+to+demonstrate+or+complete+your+work+or+be+licensed+from+third++created+by+the+use+of+t
e+SOFTWARE%3B+provided+that+you+should+not+use+the+rated+by+the+use+of+the+pictures+in+any+illegal+or
immoral+manners%2C+nor+shall+you+grant+your+right+to+pictures+in+any+illegal+or+immoral++to+use+to+any+thi
d+party.+SAMSUNG+does+not+provide+any+warranty+or+represent+or+use+to+any+third+nation+to+
hese+pictures+from+third+parties.%0D%0A%0D%0ATHIS+SOFTWARE+AND+AND+in+addition+to+these+pictures+from+third+ACCOMPANYING+DOCUMENTATAI
N+%28INCLUDING+INSTRUCTIONS+FOR+USE%29+ARE+PROVIDED+IN+ACCOMPANYING+DOCUMENTATAION++%22AS+IS%22+WITHOUT+WARRANTY+OF+ANY+KIND.+FURTHER%2C+SAMSUNG+DOES+NOT+WARRANT%2C+GUARANTEE%2C+OR+MAKE+ANY+REPRESENTATIONS+REGARDING+THE+USE%2C+OR+THE+RESULTS+OF+USE%2C+OF+THE+SOFTWARE+OR+DOCUMENTATION+IN+TERMS+OF+CORRECTNESS%2C+OF++ACCURACY%2C+RELIABILITY%2C+CURRENTNESS%2C+OR+OTHERWISE.+THE+ENTIRE+RISK+AS+TO+THE+RESULTS+AND+PERFORMANCE+OF+THE+SOFTWARE+IS+ASSU
ED+BY+YOU.+IF+THE+RESULTS+AND+PERFORMANCE+OF+THE+SOFTWARE+IS+ASSUMED+BY+TWARE+OR+DOCUMENTA
ION+IS+DEFECTIVE%2C+YOU%2C+AND+NOT+CYBERLINK+OR+ITS+DEALED+OR+DOCUMENTATION+IS+RS%2C+DISTRIBUTORS%2C+AGENTS%2C+OR+EMPLOYEES%2C+ASSUME+THE+ENTIRE+COST+OF+ALC+L+NECESSARY+SERVICE%2C+REPAIR+OR+CORRECTION.%0D%0A%0D%0ASAMSUNG+DISCLAIMS+ALCESSARY+L+OTHER+WARRANTIES%2C+EITHER+EXPRESS+OR+IMPLIED%2C+INCLUDING+BUT+NOT+LIMITEDHER++TO+THE+IMPLIED+WARRANTIES+OF+MERCHANTABILITY%2C+FITNESS+FOR+A+PARTICULAR+PUTHE+IMPLIED+WARRANTIES+OF+RPOSE+AND+NONINFRINGEMENT%2C+REGARDLESS+OF+WHETHER+IT+IS+MADE+BY+SAMSUNG%2C+E+AND+ON+THIS+SAMSUNG+PRODUCT.+SAMSUNG+DOES+NOT+WARRANT+THAT+THE+SOFTWARE+WILL+BE+HIS+S
MSUNG+UNINTERRUPTED+OR+ERROR-FREE.+NO+ORAL+OR+WRITTEN+INFORMATION+OR+ADVICE+GIVEN+TERRUPTED+OR+BY+SAMSUNG%2C+ITS+DEALERS%2C+DISTRIBUTORS%2C+AGENTS+OR+EMPLOYEES+SHALL+CREATE+A+WARRANTY+OR+IN+ANY+WAY+INCREASE+THE+SCOPE+OF+THIS+WA
RANTY+AND+YOU+MAY+NOT+RELY+ON+ANY+SUCH+INFORMATION+OR+ADVICE.%0D%0A%0D%0ANEITHER+SAMSUNG+NOR+ANELY+ON+ANY+SUCH+INFORMATION+OR+YONE+ELSE+WHO+HAS+BEEN+INVOLVED+IN+
HE+CREATION%2C+PRODUCTION+OR+DELIVERY+OF+ELSE+WHO+HAS+BEEN+INVOLVED+IN+THE++THIS+PRODUCT+SHALL+BE+LIAB
E+FOR+ANY+DIRECT%2C+INDIRECT%2C+CONSEQUENTIAL+ORS+PRODUCT+SHALL+BE+LIABLE+FOR+ANY++INCIDENTAL+DAMAGES+%28INCLUDING+DAMAGES+FOR+LOSS+OF+BUSINESS+PROFITS%2C+BUSIDENTAL+DAMAGES+INESS+INTERRUPTION%2C+LOSS+OF+DATA%2C+LOSS+OF+BUSINESS+INFORMATION%2C+OR+OTHS+ER+PECUNIARY+LOSS%29+ARISING+OUT+OF+THE+USE+OR+INABILITY+TO+USE+SUCH+PRODUCTECUNIARY++EVEN+IF+SAMSUNG+HAS+BE
N+ADVISED+OF+THE+POSSBILITY+OF+SUCH+DAMAGES.%0D%0A%0N+IF+SAMSUNG+HAS+BEEN+ADVISED+OF+THE+POSSBILITY+OF+SUCH+D%0AYou+agree+to+bear+the+full%2C+complete%2C+and+sole+responsibility+for+usYou+agree+to+bear+the+ing+the+Software+of+any+purpose.+Yo
+also+agree+to+indemnify+and+hold+SAMSUNthe+Software+of+any+G+harmless+from+any+claims%2C+proceedings%2C+damages%2C+costs%2C+and+expensermless+from+any+s+resulting+from+your+use+of+the+SOFTWARE+for+any+illegal+pu
pose.+%0D%0AUposulting+from+your+use+of+the+SOFTWARE+for+any+illegal+n+termination+of+this+Agreement%2C+you+should+destroy+the+Software+and+the+Drmination+of+this+ocumentation+and+all+the+cop
es+thereof+and+remove+and+delete+the+Software+from+your+hard+disk+or+other+storage+device.
%0D%0AThis+agreement+constitutesyour+hard+disk+or+other+storage++the+entire+agreement+between+
ou+and+SAMSUNG.+This+agreement+shall+be+gover+entire+agreement+between+you+and+ned+and+con
trued+in+accordance+with+the+laws+of+South+Korea+and+shall+benefit+SAMSUNG%2C+its+successors+and+assigns.+%0D%0AAny+claim+or+dispute+between+you+and+SAMSUNG+or+against+any+agent%2C+employee%2C+successor+or+assign+of++and+SAMSUNG+or+against+any+SAMSUNG%2C+whether+related+to+this+agreement+or+otherwise%2C+and+any+claim+or+dispute+related+to+this+agreement+or+the+relationship+or+duties+contem
lated+under+this+agreement%2C+including+the+validity+of+this+arbitration+clausender+this+%2C+shall+be+resolved+in+Seoul%2C+Korea%2C+pursuant+to+the+Korea+Arbitrationshall+be+resolved+in++Act.%0D%0A++&submitBtn=Download

 

 

Sende hele eulaen via URL .. :(

Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...