How to add the discussion forum in existing application?
Configured with the my application running in WAS and using java snippets i can able to get connected to the connections and get the response .
But with javascript snippets there is a problem .Unable to configure SBT JS and run javascript snippets.
https://localhost:9443/sbt/WebContent/js/sdk/sbt/connections/ForumService is not found
always 404 error in web console.
please help me out
thanks in advance
You should make sure you have the sbt.web project on your server. It sounds like the ForumsService dojo file isn't found.
Also make sure that your managed-beans.xml file is configured, and set properly to point to your connections server.
Here is a snippet which shows the path invocation for ForumService. You can see many more examples in the GitHub Project and reference the wiki which describes your first JS App http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=SDK+docs#action=openDocument&res_title=Adding_the_SDK_to_your_web_application_SDK1.0&content=sdkcontent
require(["sbt/connections/ForumService", "sbt/dom", "sbt/json"],
function(ForumService, dom, json) {
var forumService = new ForumService();
var forumUuid = "%{name=ForumService.forumUuid}";
var promise = forumService.getForum(forumUuid);
promise.then(
function(forum) {
dom.setText("json", json.jsonBeanStringify(forum));
},
function(error) {
dom.setText("json", json.jsonBeanStringify(error));
}
);
}
);
Related
I faced a problem while creating static pages in Next JS with GraphQL requsts using fetch.
I've created page where I render over 100 list of data and also created static dynamic pages for those items using generateStaticParams function provided by Next.
Local build was done without any issues but when I deployed it to vercel, build crashed.
I am wondering if the problem is somewhere in WordPress.
To check it I replaced those static pages with https://jsonplaceholder.typicode.com/ - free fake API.
And with that API everything works fine.
Error that appeared during vbercel build:
I would be grateful if someone could help me with this.
Thanks :)
I tried different API to check if this error will also happen, but everything worked fine.
My operating system: Windows 11
Node version: 18.12
Next version: 13.1.6
The issue appears to be with using fetch in Server Components.
You can either use axios OR inside next.config.js set:
module.exports = {
experimental: {
enableUndici: true
}
}
I have been working on my website for a month now and just realized that there is this extra _N_E server that is providing access to my raw source code used for each page.
I am using NextJS and suspect that Sentry may be responsible here but I cannot find anything in their documentation about it. This is a risk because not only does this happen in development but in production as well and I do not users to have access to my raw source code.
Has anyone ever seen this before?
Can anything be done about it and still get accurate results from Sentry?
Publishing sourcemaps publically means anyone (including Sentry) have access
There are two ways you can achieve this
Setup a CDN rule that only allows Sentry's servers to get the sourcemaps, a.k.a IP Whitelisting
You could upload SourceMaps to sentry - https://docs.sentry.io/platforms/javascript/guides/react/sourcemaps/uploading/
Here is a ticket describing this problem and how to resolve it.
Make sure to use #sentry/nextjs >= 6.17.1.
In your next config file, you want to add the hidden-source-map flag. This boolean will determine if the source map should be uploaded or not. For instance, you may want to conditionally set it for preview deploys.
// next.config.js
const nextConfig = {
// ... other options
sentry: {
hideSourceMaps: process.env.NEXT_PUBLIC_VERCEL_ENV === "production",
},
}
One thing to note. Previously I was using v7.6.0 and was able to get the source map files. I have now upgraded to v7.14.1 and am no longer able to get the source files to display on deploys, regardless of the flags condition. Not sure if this is a regression or just a partially implemented feature.
So we recently changed our landing page from create-react-app to using Next.js. Our old create-react-app had a basic default service worker registered on users browsers.
Whenever I switched over to our new Next.js website, we realized that users who had been there before would continue to get a crappy cached version of the old website.
I've found a couple of discussions talking about this issue already, but neither solutions seem to be working for me. Those two discussions are:
A website is not refreshing because of caching of service worker, after switching from React to Next.js. How to force update?
https://www.asapdevelopers.com/service-worker-issue-nextjs-framework/
Both of these solutions essentially consist of adding a new service worker file to your Next project with some code to delete the existing service workers. That code looks like
if ("serviceWorker" in navigator) {
window.addEventListener("load", function () {
navigator.serviceWorker.getRegistrations().then((registrations) => {
console.log("--");
for (let registration of registrations) {
registration.unregister().then((bool) => {
console.log("unregister: ", bool);
});
}
if (registrations.length) {
window.location.reload();
}
});
});
}
So i've tried this. My old service worker was served via a file at route OUR_URL/service-worker.js. I added a public directory to my Next project and added a file with the same name and the code above to my project. I then linked this file in my _document.js and can confirm that it runs, as well as I'm able to find it on my Next.js site. The URL for both the new and old files are identical. Unfortunately though, it looks like the issue persists.
In one of the other articles linked above, it also mentions putting this file in the root directory of your Next project. This doesn't make much sense to me as it isn't then being served in anyway that I'm aware of, but I gave this a shot as well, still with no luck.
Anyone have any idea what I might be doing wrong here, or what I could do to fix this? Essentially we just want to force remove any and all old service worker so that our new website loads correctly.
Service workers are (at least generally) registered via the site itself and not automatically found by browsers (at least not yet).
This code (unregistering all service workers for the domain) should go in whatever is being sent from next.js to the browser (e.g. index.js). If you put this on your home page all users going there should have the problem resolved. If you have reason to suspect (based on traffic data) that users have other pages bookmarked you might want to include this in a universal bundle or footer.
I create this web application that provides sound whenever the number in the window changes. When I run my application in Visual Studio, The sound perfectly works but when I open my web with IIS 7, the sound doesn't work anymore.
What causes this? And How can I solve it?
I'm using ASP.Net by the way.
thanks for immediate response.
This is the code that i use
public void providesound()
{
System.Reflection.Assembly a =System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream s = a.GetManifestResourceStream("~/sound/beep.wav");
SoundPlayer player = new SoundPlayer(s);
player.Play();
}
Since the sound is playing in your dev environment the only reason I can think of for sound not playing when deployed in IIS is that; your IIS is not configured to send the sound file across to the client. In simple words if you have a sound file say with .wav extenstion, in IIS under MIME Types of you website see if you have an entry for this extension. If not the following link can help you create the MIME entry:
http://technet.microsoft.com/en-us/library/cc725608(v=ws.10).aspx
I believe this would solve your problem, but if not then you should post the code as asked by Damien and also add the details about how you are publishing your site (step by step).
Edit 1:
Looking at the code that you are using I dont think you can make the sound work that way on your client. here are two link refer them: asp.net SoundPlayer not playing from server , How to run a .wav in client. ASP.NET
Hope this helps.
I'm able to accomplish this task by creating a Javascript
function EvalSound(soundobj)
{
var thissound = document.getElementById(soundobj);
thissound.play();
}
<audio id="audio1" src="Sound/beep.wav" controls preload="auto" autobuffer HIDDEN=true >
and in my .cs
public void CreateSound()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(#"<script language='javascript'>");
sb.Append(#"EvalSound('audio1');");
sb.Append(#"</script>");
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "JCall1", sb.ToString(), false);
}
You can add the CreateSound() in Button_Click.
My app is using a SignalR 1.1.2 on ASP.NET MVC
It has the following call in the View
This uses the auto-generated hub.
At this point all client and server side methods are done.
Can I get a copy of the 'hubs.js' file I get when I paste this
link into the browser.
I want to add a new javascript file to the BundleConfig.cs so I
can minify this file and try and improve the performance of my app.
Hope someone can advise, I have done it and it seems to work, I just
want to be sure that I will not loose the ability to shift gears to
websockets, SSE, Forever-Frame depending on what the client and server
can negotiate.
MVC web optimization does not support dynamic scripts. I did it like this in my last project, it doesnt help with minifying but you can add the static script to the bundle config
(function ($) {
var dynamicScripts = ["signalr/hubs", "eventAggregation/events"];
$.each(dynamicScripts, function () {
$.ajax({
url: this,
cache: true,
dataType: "script",
async: false
});
});
} (jQuery));
if you navigate to the /signalr/hubs uri you can save this javascript file and put it in a bundle. Of course if you change anything to do with signalr then it might not work. But this is for release. Just a note that this 1.1.2