Glassfish can't find my application path correctly? - deployment

I always developed on Glassfish, using the deploy feature on it, but it seems that on productio is a little different, it seems that can't find my application path correclty.
I have this domain brainset.com.br, which you can see this screen when clicking on the link:
I didn't configure this Glassfish before, 'cause I don't know how to do it.
The website it's on air (or it should be) and I need to setup glassfish to the correct path.
brainset.com.br // gives the screen above
brainset.com.br/BRAINSET // it's the correct page, my index.xhtml
What I'm missing here ? Sorry if my post lack any information, I will provide soon as demanded, 'cause I don't know what could be useful to the post tough.
Any idea how to fix this ?

I actually found a solution, don't know if is the most correct one, but it works.
I had to acess my hosting account and navigate through the folders to found out where glassfish was installed, so inside /glassfish/domains/domain/docroot I edited this way the index.html file, then upload back the index.html overwriting it:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.brainset.com.br/BRAINSET">
</head>
</html>
I think this is not the most correct way, 'cause I think that Glassfish can contain many different applications inside of it, which itself can handle the requests and redirect to the correct application and this way it always go to the same application, but I could be wrong on this. :)

Related

Why Firefox says this page is in Quirk mode and it is not?

I am confused... all the pages start with
<!DOCTYPE html>
<html lang="en">
<head>
<title>...
When I view the source in Firefox, the first line is in italic. Is it commented by FF (last mac version 98.0.1)?
In the web tools console, FF sometimes (not for all the pages) displays a warning saying that the page is in quirk mode and may affect the rendering.
I have read a lot on the subject but I don't seem to understand what I can do to fix this.
Help would be appreciated.
Is it possible for you to inject an iframe without the doctype or for some third party tracking pixel to do it?
If that's the case, I'm afraid your problem is caused by that, you have an answer to the reason here:
Dynamic iframe inserted into document that is standards mode defaults to quirks mode

How to prevent Perl CGI->start_html() from printing DOCTYPE header

when using Perl CGI, it always print out the: <"DOCTYPE html ".... > header before printing out the rest of the html body, which messes up the proper display of the web page. I guess the cause is the DOCTYPE still references a very old version of HTML. This first line get generated regardless when I use $query->start_html(...);. So the question is, how to prevent that <!DOCTYPE...> line from being generated? When I delete that DOCTYPE line, my web page runs properly after that. Any insight is greatly appreciated. Thanks!
Browsers will use the DOCTYPE definition to decide whether or not to interpret an HTML (or XHTML) document in Quirks mode. I assume that's what you mean by "messes up the proper display of the web page" - you're carefully creating valid HTML5 but the browser goes into Quirks mode and the page doesn't look right.
What you want is the standard HTML DOCTYPE definition.
<!DOCTYPE html>
Unfortunately for you, the HTML generation functions in CGI.pm are unmaintained and don't have support for HTML5. So you can't get the module to generate this DOCTYPE.
Honestly, your best approach is to stop using all of the HTML generation functions and switch to a template-based approach instead. But I can see how that would be a big job so, in the short term, perhaps you can just stop using start_html(). It shouldn't be too hard to replace the call with a heredoc that contains the text that you want.
Update: The comment from Quentin below got me thinking. When I said:
you're carefully creating valid HTML5 but the browser goes into Quirks mode and the page doesn't look right
I was completely wrong. If you get the browser behaviour you want without a DOCTYPE, then you want to put the browser into Quirks mode. And that's far easier. Using the information from the Wikipedia article I linked to above, you can see that HTML 4.01 Transitional is the most recent DOCTYPE that will put all modern browsers into Quirks mode. So you can use that DOCTYPE.
$ perl -MCGI=:html -E'say start_html(-dtd => "-//W3C//DTD HTML 4.01 Transitional//EN")'
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Untitled Document</title>
</head>
<body>
And that should get the browsers working as you want them.
But relying on Quirks mode is fragile. I recommend that you consider fixing your HTML and CSS so that they work as you want when browsers are in Standards mode.

How to modify <head> tag in flutter web

So I've got flutter web up and running (pretty amazing work tbh) and I went about bench marking the Button Press Count app that it gives by default on PageSpeed Insights. The results were impressive but there's one suggestion that would seem to increase the score. Is there any way to include <link rel='preload'> for the assets they mentioned?
And would there be anyway to do code splitting as well the way webpack does it for main.dart.js
See the website here: https://flutterdemoapp.netlify.app
You can try to add this code to your index.html file which is under the web folder,
<html>
<head>
<link rel='preload'>
<script defer type="application/javascript" src="main.dart.js"></script>
</head>
</html>
If you already tried that or this doesn't work so you can use this library. It makes this automatically.

How to produce valid xhtml/xml output from Oracle ADF

I've tried to find a way to get our Oracle ADF pages to output valid code.
I see a reference in Can we configure Oracle ADF Faces to produce valid XHTML? but it's dated back in 2008 or so.
Is there still no way to configure ADF to output consistent code?
With no configuration we get a html 4.01 doctype but with a class attribute in the starting html element. For starters...
If we change the content type to application/xhtml+xml, as others suggest, we get the more correct xhtml 1.0 doctype.
BUT, the generated code is still html 4.0 :(
I.e. <link href="cmp.css" type="text/css" charset="UTF-8" rel="stylesheet">, without the closing tag.
So, has anyone actually solved this or is there only workarounds available?
You may have a better chance nowadays using Alta UI, meaning you will get less validation errors than before, but a blunt answer is: NO, you won't be able to output valid XHTML from ADF.
ADF's wasn't geared towards a Light Effective HTML output at the beginning, but towards a Desktop-Like experience on web browser.
With Alta UI, things get slightly better.

Live preview with LESS or SCSS?

I am trying to figure out if there is a way to use LESS or SCSS without having to save the document or refresh the browser. At the moment I use CSS Edit which is great for live previews but I cant find a way to get the live previewing to work with LESS or SCSS. My ideal situation would be to get a truely live (or as close to) setup working with Textmate and my broswer. I have looked at a few options, WebPutty is great but it's in Beta and web based so I'd love a solution that could fit into my existing workflow.
Many thanks
This might be what you're looking for: livereload.com
I only just found this myself while Googling for the same problem, Haa!
It's currently only for 64-bit Macs. Its also in beta..
Windows version under dev.
Can't seem to find a link to the v1 that is mentioned on the site?
If you're using static files you can use this code taken from http://f.cl.ly/items/0y2G351r3O3T3j1b401u/Live-LESS-previewing-in-Espresso.html
<!-- Link directly to LESS stylesheet first -->
<link rel="stylesheet/less" href="style.less" type="text/css" media="screen" />
<!-- Then link to LESS, and enable development watch mode -->
<script src="less-1.2.1.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
less.env = "development";
less.watch();
</script>
<!-- VoilĂ ! Instant LESS previews in Espresso -->
However, if you are using localhost, I've not figured out how to get this to work yet.
Check out EDGE. http://getedge.io - it let's you live edit Sass and LESS files from Sublime Text or Textmate. No need to save the file - it updates as you type. You can sign up for the private beta right now.
There is no complete solution for what you are looking.
Chrome dev tools (with sass source maps enabled) is your best bet but I don't think you can do mixins
http://livestyle.emmet.io/ is another option you might want to try
Brackets works well with live changes but applies only for chrome
Here's what I do and it serves the purpose and works like a charm in mac/pc and linux
Have one terminal open that does sass --watch
Have another terminal/app that lets you run live-reload
Your sass will compile and as soon as your stylesheet changes all your browsers get refreshed
But you can't do style injection with this, meaning the page WILL refresh (if you want to theme dialogs, you will have to open them again) But there are other tools available for style injection as well
Hope this helps!
live.js is your solution :)
It doesn't not only work with html, js, css but also less.
You have to trick it with filetype of css:
<link rel="stylesheet/less" type="text/css" href="stylesheets/main.less.css">
Tried the bookmark version on rails local server. Works a breeze!
CssRefresh
My co-worker and I whipped up http://less2css.org the other day. Allows you to choose the version and see your less converted in realtime.
Hope it helps someone.
I think there is no such add-on right now, but I'm also a fan of Live CSS Editor (if that's what you meant by CSS Edit).
I think it would be useful to have something similar with SASS or LESS support, so I made a quick prototype for such Chrome add-on (analogue to Live CSS Editor). It includes syntax highlighting and LESS support with use of client-side LESS library. It's not user-friendly yet so not a candidate to the Chrome Store, but here is it's Google Code Project where it can be downloaded and loaded into Chrome as unpacked extension. I'll try to improve it over time, but anyone else can try too ;)
Screenshots and a bit more are in this blog post.