• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to write java code in wordpress?  RSS feed

 
Sergiu Dobozi
Ranch Hand
Posts: 107
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know it's possible to program javascript into a wordpress website. However, I only learned Java and I have a website where I teach Romanian. I want to create my own chatroom but there are a few things that bug me.
1. I read somewhere on this forum that servlets are no longer being used. Is this true and why?
2. The code will be deleted/messed up each time there is an update to the theme for some reason.
3. Maybe it's not as easy to create a chatroom than it is to just do it in Javascript?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know about WordPress and Java. However:

Sergiu Dobozi wrote:1. I read somewhere on this forum that servlets are no longer being used. Is this true and why?

No, this is not true. Applets are obsolete. Applets are small Java programs that run on the client side (in a browser) on a web page. They were what made Java cool in 1997, because at that time the World Wide Web consisted mostly of static pages with text and images. Now you could make web pages interactive! The Java browser plug-in has a bad name, because there have been many security problems with it in the past, and applets have been replaced by JavaScript long ago. In Java 9, the Applet API is going to be deprecated and Oracle is most likely not going to ship the browser plug-in with Java anymore.

Servlets, however, are still used very widely and are the basis for almost all Java web application frameworks. However, most people don't program directly with servlets - they use one of the more powerful web application frameworks, which runs on top of servlets. For example Spring Web MVC (part of the Spring Framework).

Sergiu Dobozi wrote:2. The code will be deleted/messed up each time there is an update to the theme for some reason.

I have no idea. This has to do with how WordPress works. I've done a little bit of customizing themes with WordPress for my own blog. If you mess with the files of an existing theme, your changes will be overwritten if there is an update to the theme. But you can make a child theme, and then this won't happen. This has however nothing to do with programming in Java, and I am far from a WordPress expert.

Sergiu Dobozi wrote:3. Maybe it's not as easy to create a chatroom than it is to just do it in Javascript?

If you create a chatroom, you'll need some part of it running on the server side, to store and forward the messages that people type in. So, you might write part of it in JavaScript that's running in the browser, but there will also need to be a server side part, which you could write in Java. I have, however, no idea how that would integrate with WordPress.
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also have a look to Vaadin framework. Their website I see also provides some video tutorials (<-- here) to start.
 
Tim Moores
Saloon Keeper
Posts: 4035
94
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WordPress is written in PHP, so if you're thinking of extending it, Java would not be the best choice.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!