Vijitha Kumara

Bartender
+ Follow
since Mar 24, 2008
Vijitha likes ...
Chrome Fedora Hibernate
Cows and Likes
Cows
Total received
42
In last 30 days
0
Total given
27
Likes
Total received
88
Received in last 30 days
0
Total given
145
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Vijitha Kumara

Have you defined security-role in web.xml?
2 months ago
Did you check the certificates (you seems to have control in the server too?) in the server? May be you need to check with installing them in your client JVM.
2 months ago
Problems, Questions and Solutions

JstlUriNotResolved: What to do about "The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved "

ResourceUrlProblems: Why don't images load? or style sheets? Or script files? Why a 404 on form submit?

TypesOfPaths: What are the different types of paths used in Java web apps?

JavaScriptAndJsp: What's all this about not mixing JavaScript and JSP?

CanIMixJSPWithJavaScript: Can you mix JSP and JavaScript?

RedirectForward: What is the difference between a sendRedirect and a forward?

JspOrServlets: JSP versus Servlets, which is better?

WhyNotUseScriptlets: Why shouldn't you put java in your JSP?

BeansNotFound : Why can't the server find my beans?

IllegalStateException: The most common cause of IllegalStateException, and an easy rule of thumb for preventing it.

IncludesActionDirective : What is the difference between the include directive and  the include action?

ElOrJstlNotWorkingAsExpected : EL not evaluating? JSTL not working as you expect?

WeirdWordCharacters: Word-generated "Smart quotes" getting you down?

ScripletVariablesAndTheEl: Why can't the EL access my scriplet variables?

Model1Model2MVC: What is the difference between Model 1 and Model 2? What is MVC?

HtmlHasNoComboBox:  What is a Combo Box? Why it's important not to refer to HTML select lists as Combo Boxes.

WhyNotUseJstlSqlActions: Why should the JSTL SQL actions (tags) be avoided?

WhichVersionAmIRunningOn: If you're not sure what the server your code is running on supports



Resources

SpecificationUrls : Locations of relevant specifications (Servlets, JSP, JSTL)

The 2nd edition of Volume 1 of Core Servlets and JSP has the second edition available as a free PDF.

JavaRanchJournalArticles : Java Ranch Journal articles relevant to JSPs

JstlTagLibDefinitions : Download locations and URIs for JSTL 1.0 and JSTL 1.1

Introduction to JSTL: part 1 - EL, part 2 - Core, part 3 - Formatting and I18N, part 4 - XML and SQL


How To's

SetupJstlForJsp2 : How to set up the JSTL 1.1 for JSP 2.0

ServletsWebXml : Setting up a web.xml file for Servlets 2.4 (Note: required in Tomcat 5 to enable the EL)

PackageYourBeans : Why you should always put your Java classes into a specific package.

DefineELFunctions : How do I define EL functions that map to static methods?

DoubleSubmitProblem : How to avoid duplicate submissions?

NoCacheHeaders : Want to prevent the browser from caching the page?

JspAndExcel : How to download Excel spreadsheets from a JSP

FileUpload : How do I upload a file with JSP/Servlets?

PaginationOrPaging : How do I limit the number of rows displayed in the browser?

PostRedirectGet : A simple example of the PRG pattern implemented in a JSP page.

JstlTable : Using nested JSTL forEach tags to display a table in an HTML page

RelativeLinks: How to build robust relative links in Servlet and JSP applications

BodyTagContent


CategoryFaq ServletsFaq TomcatFaq
3 months ago
JSP 2.0 was introduced in 2002 with the JSTL and EL intended to replace Java scriptlets in JSP pages. 2002! In 2017, that is over 15 years ago! If you are still using scriptlets in JSPs, you are 15 years behind the times.

15 years!

Java scriptlets have been obsolete and discredited since the introduction of JSP 2.0 and there are many good reasons not to use Java scriptlets in JSPs including:

  • Readability -  There are already enough syntaxes in web pages -- HTML, JavaScript and CSS. Using JSTL tags in the view just makes pages easier to read without a lot of Java code jumbled into them. Keep the Java code in Java classes where it belongs.
  • Separation of Concerns - Best practices dictate that presentation logic and business logic should not be mixed.
  • Reusability - How would one reuse the Java code in a JSP in another JSP page or in a Java class?
  • Maintainability - A database column changes and you will be hunting through all your JSPs for places to change. Better to do this in Java classes lets where it can be easily refactored.
  • Scriptlets Break OOP - scriptlets cannot be extended or encapsulated.
  • Getting business logic out of JSPs lets you take advantage of the Java bean paradigm


  • Due to the above, a developer using scriptlets is a clear warning sign that a developer:

  • Is not serious about their craft
  • Does not know what they are doing
  • Does not care to follow best practices
  • Has not updated their skills in over 15 years
  • All of the above


  • Do you want this to be you?

    This Javaranch Journal article explains the evolution of modern best practices with regards to web application structure.



    JspFaq
    3 months ago
    T h e . C o d e R a n c h . J o u r n a l - S e p t e m b e r . 2 0 1 7 . E d i t i o n


    Howdy from all the CodeRanch staff, and welcome to the September edition of the Journal.


    W h a t ' s . N e w ?


  • Well, the Java 9 has just got released, go ahead and give it a try. News is that a new time based release model has been proposed along with a new way of versioning the Java releases based on year and month.
  • Our thread boost algorithm got even smarter, you will find more information on thread boost feature here


  • I n t e r e s t i n g . C o d e R a n c h . F o r u m . P o s t s


  • Every now and then we get to talk about synchronization in servlet
  • "Java vs C", A debate you will find interesting to read
  • Discussion on basics of multi-dimensional arrays
  • Discussion on how to design a basic linked list


  • B l o g . E n t r i e s . F r o m . S t a f f


  • Jeanne writes about her experience on Maker Faire
  • Jeanne blogs on agile scrum "Using Agile Games to improve meetings – the virtual/remote edition"


  • B o o k . P r o m o t i o n s . & . W i n n e r s 


    There's a book (or software) promotion just about every week at CodeRanch. Just ask a question in the appropriate forum and you're eligible to win a copy of the book (or license for a software).

    Check Book Promotions Schedule here

    Some upcoming promotions are:

  • Functional Programming in Java: How functional techniques improve your Java programs by Pierre-Yves Saumont
  • Head First Android Development (2nd Edition) by Dawn & David Griffiths
  • Kotlin in Action by Dmitry Jemerov & Svetlana Isakova
  • Head First Agile by Andrew Stellman & Jennifer Greene

  • And a big Congratulations to our past Winners - https://coderanch.com/wiki/659681/Book-Promotions-Winners-Page


    B o o k s . A n d . R e v i e w s


    We have several forums dedicated to talk about books. Here are some interesting reviews and recommendations from the CodeRanch staff in our Book Reviews forum

    The Book Review Grid will give you an overview from another angle.


    T h e . M o o s e . o n . S o c i a l


    The CodeRanch announces latest news/developments frequently on our social media outlets. You can find us at:

  • Twitter
  • Google+
  • Facebook

  • Follow / Like us so you don't miss a thing.


    A b o u t . T h e . E d i t o r


    Vijitha Kumara has been a member of CodeRanch since 2008 and a moderator since 2011.


    S u g g e s t i o n s / F e e d b a c k


    If you have any feedback on this month's journal then feel free to create a topic in our Ranch-Office - http://www.coderanch.com/forums/f-10/Ranch-Office


    J o u r n a l . A r c h i v e


    Our previously published journals are available online - http://www.coderanch.com/t/660078/Wiki/Java-Ranch-Journal
    3 months ago
    There's a basic tutorial at Oracle here
    4 months ago
    Have you verified you have the correct and proper dependencies required, as I see you would only need a client implementation here?
    4 months ago
    Well, at minimum you need to identify the purpose and the expected functionality of the class which is what defines what type of properties/members required by the the class.

    So if you have a properly designed class diagram then you would identify the properties defined there (may be there's only operations defined, a rare case, so you need to see what members are required) so you could define the fields in the class appropriately. And then see how the instance/class member methods can be derived from that.

    You may want to check on this to see how a basic application of class/objects is used.
    4 months ago
    I think "os.arch" would give you JVM architecture not the OS'.

    There's a property "sun.arch.data.model" which gives whether 32/64 bit operation according to this.
    4 months ago
    In #23 you are closing the input, remove that and run and see what happens next.

    And Welcome to CodeRanch!
    4 months ago
    If you look at your System.out.. statement and see what you are trying to do you will understand what's the problem? Check how you have defined "whatToDo" in your class and how you try to use it.

    And welcome to CodeRanch!

    4 months ago
    Did you update recently? Perhaps BIOS upgrade as noted in that thread?
    4 months ago
    Try raising a JIRA in the project and see whether they have any compatible version.
    4 months ago