How to run Servlet on Github? - eclipse

I have dynamic web project which I have made using Eclipse IDE and working correctly on tomcat. But when I uploaded the project on Github its servlets are not loading however HTML files are working fine.
So my question is how to run those servlets on Github?
<a target="_top" href="showDriveClass"><input type="button" value="Show Drives" id="bt1" title="This will show current drives in your Sytem"/></a>
<a target="_top" href="DetailPdClass"><input type="button" value="Details" id="bt3" title="Details of Your Drives"/></a>
<a target="_top" href="CompareDriveClass"><input type="button" value="Compare" id="bt2" title="Compare all drives of your system"/></a>
<input type="button" value="About" id="bt4" title="About Web Drive Detector"/>
<input type="button" value="help" id="bt5" title="Help Contents"/>
In this html pages are loading but first 3 servlets are not.

This is not something Github does. It will render certain kinds of files in your repository for easier viewing, but it is not an application container.

Related

How render elements based on device in server side using sightly (HTL)

Try to render elements based on device screen size, say for example I have two DIVs (desktop and mobile) and I wanted to render desktop DIV for desktop user only and mobile so on.
<sly data-sly-test="${ANY_LOGIC_HERE}">
<div class="desktop-render">
<button type="button" aria-label="${item.Label}" class="btn btn-primary btn-desktop">Click Here</button>
</div>
</sly>
<sly data-sly-test="${ANY_LOGIC_HERE}">
<div class="mobile-render">
<button type="button" aria-label="${item.Label}" class="btn btn-primary btn-mobile">Click Here</button>
</div>
</sly>
I know there was some CSS/JS trick, but I need it through server sides. So that on-page view source can have only one div.
Before answering this, I'll remind you that it's generally bad practice to render different markup per device/user-agent. That makes your pages non-cacheable and user-agent is generally not very reliable. There are other techniques, from client-side DOM manipulation to dedicated mobile pages (which you could redirect to in case the device is a mobile).
That said, there's a helper MobileUtil that you could leverage in your Use-Object/Sling Model to determine if the device requesting the page seems to be a mobile.
Make sure to check all AEM server-side mobile APIs!

Netlify does not recognize form in nuxt app

We implemented a simple nuxt app with a basic form and deployed it to netlify.
When pressing the "Submit" Button of the Form, we receive a 404.
Here you can find the link to the deployed netlify app:
EDIT -> Removed Link
After looking through the troubleshoot guide, they listed that the added "netlify" or "data-netlify="true" attributes should not be visible if netlify recognized your form, but they are.
Plus the form can't be found in the "form" configuration tab of the netlify backend.
Nuxt config:
SPA
Tailwind
We tried to add the necessary attributes for netlify:
netlify or
data-netlify="true" & netlify-honeypot="bot-field"
We also added a "pre-render" library called prerender-spa-plugin.
Here you can find the contact.vue page content.
Simple form with "name" attributes set according to netlify documentation.
<template>
<div>
<form name="contact" method="POST" data-netlify="true" netlify-honeypot="bot-field">
<p class="hidden">
<label
>Don’t fill this out if you're human: <input name="bot-field"
/></label>
</p>
<p>
<label
>Name
<input
type="text"
name="name"
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white;"
/></label>
</p>
<p>
<label
>Email
<input
type="email"
name="email"
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white;"
/></label>
</p>
<p>
<button
type="submit"
name="submit"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
>
Send
</button>
</p>
</form>
</div>
</template>
<script>
export default {};
</script>
<style>
.hidden {
display: none;
}
</style>
It would be great if we can manage to fix this, so that netlify finally recognizes our form.
Netlify comes with built-in form handling. Our build bots do it by parsing your HTML files directly at deploy time, so there’s no need for you to make an API call or include extra JavaScript on your site.
The form is required to be in the rendered files at deploy time. The problem with SPA mode is that none of your pages are actually rendered as HTML. You can check this by right clicking the page, and clicking "View Page Source". You won't be able to find the form.
Netlify addresses this problem here in their docs.
They have a specific post for fixing this for a Vue app here
A little more digging on the the issue and we find a Nuxt solution here:
Place the following in static/form-dummy/index.html:
<form name="MYFORM" action="/form/success" netlify>
<!-- form controls here -->
</form>
Place the following in pages/form/index.vue (Or whenever you've named your Vue file)
<form name="MYFORM" action="/form/success" method="post">
<input type="hidden" name="form-name" value="MYFORM" />
<!-- form controls here -->
</form>
From the post:
You just need to make sure you add that hidden in the Vue component so that Netlify recognises the form submission as associated with the form called MYFORM. I think you also need to ensure all the inputs you want to receive data for are on both forms.

Unable to receive form submissions on Netlify deploys

I am using a simple form that was taken from one of the Netlify related docs:
<form name="contact" action="/" method="post" data-netlify="true">
<div className="field">
<label htmlFor="name">Name</label>
<input type="text" name="name" id="name" value="dave"/>
</div>
<div className="field">
<label htmlFor="email">Email</label>
<input type="text" name="email" id="email" value="email#email.com" />
</div>
<div className="field">
<label htmlFor="message">Message</label>
<textarea name="message" id="message" rows="6"></textarea>
</div>
<input type="submit" value="Send Message" className="" />
</form>
In using gatsby develop and working with/submitting the form, things seem to work fine. I get no errors and get redirected to the home page as expected.
After deploying the site with Netlify and trying to submit the form, I get the following page error:
In my Netlify backend, the form appears in the console but I cannot/do not receive submissions.
I am using a barebones gatsby-config.js, only incorporating gatsby-source-wordpress and gatsby-plugin-google-analytics.
I also tried adding /no-cache=1 to form action.
Can anybody advise?
It might also be worth noting that I have coded my form as a component and am importing it into my footer as such. In that way, it may be imported multiple times on different pages as mentioned in point 3 of this StackOverflow answer.
Thanks.
I learned that because I'm using Gatsbyjs, and Gatsby + Netlify = javascript forms, I needed to add another input type="hidden" to my form:
<form name="my-form" ... >
<input type="hidden" name="form-name" value="my-form" />
The documentation for this wasn't immediately clear but below are some links that address this:
Here's a link to an article that pointed me to the answer: How to
Integrate Netlify’s Form Handling in a React App
Here's another one if you're building in Vue: How to Integrate
Netlify Forms in a Vue App
And all about Netlify Forms
If you are using any redirect method then you have to add _redirects file in your root folder and add paths to it so that redirect can work.
It's may be confusing but you can visit this link for more help.

How Do Laravel Spark Forms Submit?

Laravel Spark has a number of forms in its settings area. Here's one that adds teams.
If I look at the source code of this form, I see the following.
The HTML source for this form looks like the following
<form role="form" class="form-horizontal">
<div class="form-group">
<label class="col-md-4 control-label">
Team Name
</label>
<div class="col-md-6">
<input type="text" id="create-team-name" name="name" class="form-control">
<!---->
<span class="help-block" style="display: none;">
</span>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-4 col-md-6">
<button type="submit" class="btn btn-primary">
Create
</button>
</div>
</div>
</form>
Specifically, the form itself has no action or type parameter
<form role="form" class="form-horizontal">
My assumption is there's some javascript running that handles all this (a Vue JS component), but it's not clear
Where the Team Creation javascript source lives, and/or where Spark creates the component
How I can backtrack how a particular form to its javascript
Experienced programmer here -- just new to Spark and hoping this is simple/obvious for an experienced Spark developer.
Each <form> in Spark is typically handled by a Vue.js component containing its definition, and although they don't have action or method attributes, they do have special Vue directives, such as #submit (or #click if it's a <button type="submit">). The reason you don't see them in HTML in dev tools, is because those directives are compiled before rendering.
So the form you're referring to is wrapped into a <spark-create-team> tag. You can find the code that initializes this component in /resources/assets/js/spark-components/settings/teams/create-team.js; you'll also note that it simply requires the component definition from Spark's /vendor directory. In other words, component and form definitions are stored in Spark vendor files at /vendor/laravel/spark/resources/assets/js/settings/teams/create-form.js. Can you see that settings/teams/create-form.js part is identical? This should help you locate the underlying JS code for any component or form -- just search Spark's JS assets, and eventually its folder structure will become a second nature to you.
As for the SparkForm class, it's a helper class designed for working with form errors. Its definition is in vendor/laravel/spark/resources/assets/js/forms/form.js file, although I don't think you'll ever need to make any modifications to it; just follow Taylor's examples with forms using Axios, and you shouldn't have any problems with submissions or validation. Although for the later point, validation, I'd suggest using an external package, instead of defaulting to server-side validation, but that's a bit off topic here.
Hope this helps.

How to find jsp filename for a UI element on a webpage

Hi and thanks for the help,
I am trying to add a button on my company's intranet site, but dang if there aren't 1000 jsp files obscuring my effort.
How do I find out which file contains a specific UI element?.
Here is what FireBug shows me:
<div class="TabContent TitleTabContainer">
<a class="TabTitle" role="tab" onclick="return !1;"href="javascript:void(null);" title="Documents" style="width: auto;">Documents</a>
</div>
Thank you,
WH